Class InstanceProfileProps
Properties of an Instance Profile.
Inheritance
System.Object
InstanceProfileProps
Implements
Namespace: Amazon.CDK.AWS.IAM
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class InstanceProfileProps : Object, IInstanceProfileProps
Syntax (vb)
Public Class InstanceProfileProps
Inherits Object
Implements IInstanceProfileProps
Remarks
ExampleMetadata: infused
Examples
var role = new Role(this, "Role", new RoleProps {
AssumedBy = new ServicePrincipal("ec2.amazonaws.com")
});
var instanceProfile = new InstanceProfile(this, "InstanceProfile", new InstanceProfileProps {
Role = role,
InstanceProfileName = "MyInstanceProfile",
Path = "/sample/path/"
});
Synopsis
Constructors
InstanceProfileProps() |
Properties
InstanceProfileName | The name of the InstanceProfile to create. |
Path | The path to the InstanceProfile. |
Role | An IAM role to associate with the instance profile that is used by EC2 instances. |
Constructors
InstanceProfileProps()
public InstanceProfileProps()
Properties
InstanceProfileName
The name of the InstanceProfile to create.
public string InstanceProfileName { get; set; }
Property Value
System.String
Remarks
Default: - generated by CloudFormation
Path
The path to the InstanceProfile.
public string Path { get; set; }
Property Value
System.String
Remarks
Default: /
Role
An IAM role to associate with the instance profile that is used by EC2 instances.
public IRole Role { get; set; }
Property Value
Remarks
The role must be assumable by the service principal ec2.amazonaws.com
:
Default: - a role will be automatically created, it can be accessed via the role
property
Examples
var role = new Role(this, "MyRole", new RoleProps {
AssumedBy = new ServicePrincipal("ec2.amazonaws.com")
});