Class: AWSCDK::Lambda::CapacityProviderProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
lambda/capacity_provider_props.rb

Overview

Properties for creating a Lambda capacity provider.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(security_groups:, subnets:, architectures: nil, capacity_provider_name: nil, instance_type_filter: nil, kms_key: nil, max_v_cpu_count: nil, operator_role: nil, scaling_options: nil) ⇒ CapacityProviderProps

Returns a new instance of CapacityProviderProps.

Parameters:

  • security_groups (Array<AWSCDK::EC2::ISecurityGroup>)

    A list of security group IDs to associate with EC2 instances launched by the capacity provider.

  • subnets (Array<AWSCDK::EC2::ISubnet>)

    A list of subnets where the capacity provider can launch EC2 instances.

  • architectures (Array<AWSCDK::Lambda::Architecture>, nil) (defaults to: nil)

    The instruction set architecture required for compute instances.

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

    The name of the capacity provider.

  • instance_type_filter (AWSCDK::Lambda::InstanceTypeFilter, nil) (defaults to: nil)

    Configuration for filtering instance types that the capacity provider can use.

  • kms_key (AWSCDK::KMS::IKey, nil) (defaults to: nil)

    The AWS Key Management Service (KMS) key used to encrypt data associated with the capacity provider.

  • max_v_cpu_count (Numeric, nil) (defaults to: nil)

    The maximum number of vCPUs that the capacity provider can scale up to.

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

    The IAM role that the Lambda service assumes to manage the capacity provider.

  • scaling_options (AWSCDK::Lambda::ScalingOptions, nil) (defaults to: nil)

    The options for scaling a capacity provider, including scaling policies.



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lambda/capacity_provider_props.rb', line 16

def initialize(security_groups:, subnets:, architectures: nil, capacity_provider_name: nil, instance_type_filter: nil, kms_key: nil, max_v_cpu_count: nil, operator_role: nil, scaling_options: nil)
  @security_groups = security_groups
  Jsii::Type.check_type(@security_groups, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuSVNlY3VyaXR5R3JvdXAifSwia2luZCI6ImFycmF5In19")), "securityGroups")
  @subnets = subnets
  Jsii::Type.check_type(@subnets, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuSVN1Ym5ldCJ9LCJraW5kIjoiYXJyYXkifX0=")), "subnets")
  @architectures = architectures
  Jsii::Type.check_type(@architectures, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19sYW1iZGEuQXJjaGl0ZWN0dXJlIn0sImtpbmQiOiJhcnJheSJ9fQ==")), "architectures") unless @architectures.nil?
  @capacity_provider_name = capacity_provider_name
  Jsii::Type.check_type(@capacity_provider_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "capacityProviderName") unless @capacity_provider_name.nil?
  @instance_type_filter = instance_type_filter
  Jsii::Type.check_type(@instance_type_filter, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbGFtYmRhLkluc3RhbmNlVHlwZUZpbHRlciJ9")), "instanceTypeFilter") unless @instance_type_filter.nil?
  @kms_key = kms_key
  Jsii::Type.check_type(@kms_key, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfa21zLklLZXkifQ==")), "kmsKey") unless @kms_key.nil?
  @max_v_cpu_count = max_v_cpu_count
  Jsii::Type.check_type(@max_v_cpu_count, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "maxVCpuCount") unless @max_v_cpu_count.nil?
  @operator_role = operator_role
  Jsii::Type.check_type(@operator_role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklSb2xlIn0=")), "operatorRole") unless @operator_role.nil?
  @scaling_options = scaling_options
  Jsii::Type.check_type(@scaling_options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbGFtYmRhLlNjYWxpbmdPcHRpb25zIn0=")), "scalingOptions") unless @scaling_options.nil?
end

Instance Attribute Details

#architecturesArray<AWSCDK::Lambda::Architecture>? (readonly)

Note:

Default: - No architecture constraints specified

The instruction set architecture required for compute instances.

Only one architecture can be specified per capacity provider.

Returns:



55
56
57
# File 'lambda/capacity_provider_props.rb', line 55

def architectures
  @architectures
end

#capacity_provider_nameString? (readonly)

Note:

Default: - AWS CloudFormation generates a unique physical ID and uses that ID for the capacity provider's name.

The name of the capacity provider.

The name must be unique within the AWS account and region.

Returns:

  • (String, nil)


62
63
64
# File 'lambda/capacity_provider_props.rb', line 62

def capacity_provider_name
  @capacity_provider_name
end

#instance_type_filterAWSCDK::Lambda::InstanceTypeFilter? (readonly)

Note:

Default: - No instance type filtering applied

Configuration for filtering instance types that the capacity provider can use.



67
68
69
# File 'lambda/capacity_provider_props.rb', line 67

def instance_type_filter
  @instance_type_filter
end

#kms_keyAWSCDK::KMS::IKey? (readonly)

Note:

Default: - No KMS key specified, uses an AWS-managed key instead

The AWS Key Management Service (KMS) key used to encrypt data associated with the capacity provider.

Returns:



72
73
74
# File 'lambda/capacity_provider_props.rb', line 72

def kms_key
  @kms_key
end

#max_v_cpu_countNumeric? (readonly)

Note:

Default: - No maximum limit specified, service default is 400

The maximum number of vCPUs that the capacity provider can scale up to.

Returns:

  • (Numeric, nil)


77
78
79
# File 'lambda/capacity_provider_props.rb', line 77

def max_v_cpu_count
  @max_v_cpu_count
end

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

Note:

Default: - A role will be generated containing the AWSLambdaManagedEC2ResourceOperator managed policy

The IAM role that the Lambda service assumes to manage the capacity provider.

Returns:



82
83
84
# File 'lambda/capacity_provider_props.rb', line 82

def operator_role
  @operator_role
end

#scaling_optionsAWSCDK::Lambda::ScalingOptions? (readonly)

Note:

Default: - The Auto option is applied by default

The options for scaling a capacity provider, including scaling policies.



87
88
89
# File 'lambda/capacity_provider_props.rb', line 87

def scaling_options
  @scaling_options
end

#security_groupsArray<AWSCDK::EC2::ISecurityGroup> (readonly)

A list of security group IDs to associate with EC2 instances launched by the capacity provider.

Up to 5 security groups can be specified.

Returns:



42
43
44
# File 'lambda/capacity_provider_props.rb', line 42

def security_groups
  @security_groups
end

#subnetsArray<AWSCDK::EC2::ISubnet> (readonly)

A list of subnets where the capacity provider can launch EC2 instances.

At least one subnet must be specified, and up to 16 subnets are supported.

Returns:



48
49
50
# File 'lambda/capacity_provider_props.rb', line 48

def subnets
  @subnets
end

Class Method Details

.jsii_propertiesObject



89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lambda/capacity_provider_props.rb', line 89

def self.jsii_properties
  {
    :security_groups => "securityGroups",
    :subnets => "subnets",
    :architectures => "architectures",
    :capacity_provider_name => "capacityProviderName",
    :instance_type_filter => "instanceTypeFilter",
    :kms_key => "kmsKey",
    :max_v_cpu_count => "maxVCpuCount",
    :operator_role => "operatorRole",
    :scaling_options => "scalingOptions",
  }
end

Instance Method Details

#to_jsiiObject



103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# File 'lambda/capacity_provider_props.rb', line 103

def to_jsii
  result = {}
  result.merge!({
    "securityGroups" => @security_groups,
    "subnets" => @subnets,
    "architectures" => @architectures,
    "capacityProviderName" => @capacity_provider_name,
    "instanceTypeFilter" => @instance_type_filter,
    "kmsKey" => @kms_key,
    "maxVCpuCount" => @max_v_cpu_count,
    "operatorRole" => @operator_role,
    "scalingOptions" => @scaling_options,
  })
  result.compact
end