Class: AWSCDK::IAM::InstanceProfileProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
iam/instance_profile_props.rb

Overview

Properties of an Instance Profile.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(instance_profile_name: nil, path: nil, role: nil) ⇒ InstanceProfileProps

Returns a new instance of InstanceProfileProps.

Parameters:

  • instance_profile_name (String, nil) (defaults to: nil)

    The name of the InstanceProfile to create.

  • path (String, nil) (defaults to: nil)

    The path to the InstanceProfile.

  • role (AWSCDK::IAM::IRole, nil) (defaults to: nil)

    An IAM role to associate with the instance profile that is used by EC2 instances.



10
11
12
13
14
15
16
17
# File 'iam/instance_profile_props.rb', line 10

def initialize(instance_profile_name: nil, path: nil, role: nil)
  @instance_profile_name = instance_profile_name
  Jsii::Type.check_type(@instance_profile_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "instanceProfileName") unless @instance_profile_name.nil?
  @path = path
  Jsii::Type.check_type(@path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "path") unless @path.nil?
  @role = role
  Jsii::Type.check_type(@role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklSb2xlIn0=")), "role") unless @role.nil?
end

Instance Attribute Details

#instance_profile_nameString? (readonly)

Note:

Default: - generated by CloudFormation

The name of the InstanceProfile to create.

Returns:

  • (String, nil)


23
24
25
# File 'iam/instance_profile_props.rb', line 23

def instance_profile_name
  @instance_profile_name
end

#pathString? (readonly)

Note:

Default: /

The path to the InstanceProfile.

Returns:

  • (String, nil)


28
29
30
# File 'iam/instance_profile_props.rb', line 28

def path
  @path
end

#roleAWSCDK::IAM::IRole? (readonly)

Note:

Default: - a role will be automatically created, it can be accessed via the role property

An IAM role to associate with the instance profile that is used by EC2 instances.

The role must be assumable by the service principal ec2.amazonaws.com:

Examples:

role = AWSCDK::IAM::Role.new(self, "MyRole", {
    assumed_by: AWSCDK::IAM::ServicePrincipal.new("ec2.amazonaws.com"),
})

Returns:



39
40
41
# File 'iam/instance_profile_props.rb', line 39

def role
  @role
end

Class Method Details

.jsii_propertiesObject



41
42
43
44
45
46
47
# File 'iam/instance_profile_props.rb', line 41

def self.jsii_properties
  {
    :instance_profile_name => "instanceProfileName",
    :path => "path",
    :role => "role",
  }
end

Instance Method Details

#to_jsiiObject



49
50
51
52
53
54
55
56
57
# File 'iam/instance_profile_props.rb', line 49

def to_jsii
  result = {}
  result.merge!({
    "instanceProfileName" => @instance_profile_name,
    "path" => @path,
    "role" => @role,
  })
  result.compact
end