Class CfnInstanceProfile
A CloudFormation AWS::IAM::InstanceProfile
.
public class CfnInstanceProfile : CfnResource, IInspectable
- Inheritance
-
CfnInstanceProfile
- Implements
-
IInspectable
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.IAM;
var cfnInstanceProfile = new CfnInstanceProfile(this, "MyCfnInstanceProfile", new CfnInstanceProfileProps {
Roles = new [] { "roles" },
// the properties below are optional
InstanceProfileName = "instanceProfileName",
Path = "path"
});
Remarks
Creates a new instance profile. For information about instance profiles, see Using instance profiles .
For information about the number of instance profiles you can create, see IAM object quotas in the IAM User Guide .
CloudformationResource: AWS::IAM::InstanceProfile
Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-instanceprofile.html
ExampleMetadata: fixture=_generated
Constructors
CfnInstanceProfile(Construct, string, ICfnInstanceProfileProps)
Create a new AWS::IAM::InstanceProfile
.
public CfnInstanceProfile(Construct scope, string id, ICfnInstanceProfileProps props)
Parameters
scope
Construct- scope in which this resource is defined.
id
string- scoped id of the resource.
props
ICfnInstanceProfileProps- resource properties.
Properties
AttrArn
Returns the Amazon Resource Name (ARN) for the instance profile. For example:.
public virtual string AttrArn { get; }
Property Value
Remarks
{"Fn::GetAtt" : ["MyProfile", "Arn"] }
This returns a value such as arn:aws:iam::1234567890:instance-profile/MyProfile-ASDNSDLKJ
.
CloudformationAttribute: Arn
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
public static string CFN_RESOURCE_TYPE_NAME { get; }
Property Value
CfnProperties
protected override IDictionary<string, object> CfnProperties { get; }
Property Value
InstanceProfileName
The name of the instance profile to create.
public virtual string? InstanceProfileName { get; set; }
Property Value
Remarks
This parameter allows (through its regex pattern ) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-
Path
The path to the instance profile.
public virtual string? Path { get; set; }
Property Value
Remarks
For more information about paths, see IAM Identifiers in the IAM User Guide .
This parameter is optional. If it is not included, it defaults to a slash (/).
This parameter allows (through its regex pattern ) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! ( \ u0021
) through the DEL character ( \ u007F
), including most punctuation characters, digits, and upper and lowercased letters.
Roles
The name of the role to associate with the instance profile.
public virtual string[] Roles { get; set; }
Property Value
- string[]
Remarks
Only one role can be assigned to an EC2 instance at a time, and all applications on the instance share the same role and permissions.
Methods
Inspect(TreeInspector)
Examines the CloudFormation resource and discloses attributes.
public virtual void Inspect(TreeInspector inspector)
Parameters
inspector
TreeInspector- tree inspector to collect and process attributes.
RenderProperties(IDictionary<string, object>)
protected override IDictionary<string, object> RenderProperties(IDictionary<string, object> props)
Parameters
props
IDictionary<string, object>