Class CfnInstanceProfile

java.lang.Object
software.amazon.jsii.JsiiObject
All Implemented Interfaces:
IConstruct, IDependable, IInspectable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:29:57.232Z") @Stability(Stable) public class CfnInstanceProfile extends CfnResource implements IInspectable
A CloudFormation AWS::IAM::InstanceProfile.

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 .

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.services.iam.*;
 CfnInstanceProfile cfnInstanceProfile = CfnInstanceProfile.Builder.create(this, "MyCfnInstanceProfile")
         .roles(List.of("roles"))
         // the properties below are optional
         .instanceProfileName("instanceProfileName")
         .path("path")
         .build();
 
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
  • Constructor Details

    • CfnInstanceProfile

      protected CfnInstanceProfile(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnInstanceProfile

      protected CfnInstanceProfile(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnInstanceProfile

      @Stability(Stable) public CfnInstanceProfile(@NotNull Construct scope, @NotNull String id, @NotNull CfnInstanceProfileProps props)
      Create a new AWS::IAM::InstanceProfile.

      Parameters:
      scope -
      • scope in which this resource is defined.
      This parameter is required.
      id -
      • scoped id of the resource.
      This parameter is required.
      props -
      • resource properties.
      This parameter is required.
  • Method Details

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      Parameters:
      inspector -
      • tree inspector to collect and process attributes.
      This parameter is required.
    • renderProperties

      @Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
      Overrides:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrArn

      @Stability(Stable) @NotNull public String getAttrArn()
      Returns the Amazon Resource Name (ARN) for the instance profile. For example:.

      {"Fn::GetAtt" : ["MyProfile", "Arn"] }

      This returns a value such as arn:aws:iam::1234567890:instance-profile/MyProfile-ASDNSDLKJ .

    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getRoles

      @Stability(Stable) @NotNull public List<String> getRoles()
      The name of the role to associate with the instance profile.

      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.

    • setRoles

      @Stability(Stable) public void setRoles(@NotNull List<String> value)
      The name of the role to associate with the instance profile.

      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.

    • getInstanceProfileName

      @Stability(Stable) @Nullable public String getInstanceProfileName()
      The name of the instance profile to create.

      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: _+=,.@-

    • setInstanceProfileName

      @Stability(Stable) public void setInstanceProfileName(@Nullable String value)
      The name of the instance profile to create.

      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: _+=,.@-

    • getPath

      @Stability(Stable) @Nullable public String getPath()
      The path to the instance profile.

      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.

    • setPath

      @Stability(Stable) public void setPath(@Nullable String value)
      The path to the instance profile.

      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.