Class: AWSCDK::Lambda::CapacityProviderProps
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::Lambda::CapacityProviderProps
- Defined in:
- lambda/capacity_provider_props.rb
Overview
Properties for creating a Lambda capacity provider.
Instance Attribute Summary collapse
-
#architectures ⇒ Array<AWSCDK::Lambda::Architecture>?
readonly
The instruction set architecture required for compute instances.
-
#capacity_provider_name ⇒ String?
readonly
The name of the capacity provider.
-
#instance_type_filter ⇒ AWSCDK::Lambda::InstanceTypeFilter?
readonly
Configuration for filtering instance types that the capacity provider can use.
-
#kms_key ⇒ AWSCDK::KMS::IKey?
readonly
The AWS Key Management Service (KMS) key used to encrypt data associated with the capacity provider.
-
#max_v_cpu_count ⇒ Numeric?
readonly
The maximum number of vCPUs that the capacity provider can scale up to.
-
#operator_role ⇒ AWSCDK::IAM::IRole?
readonly
The IAM role that the Lambda service assumes to manage the capacity provider.
-
#scaling_options ⇒ AWSCDK::Lambda::ScalingOptions?
readonly
The options for scaling a capacity provider, including scaling policies.
-
#security_groups ⇒ Array<AWSCDK::EC2::ISecurityGroup>
readonly
A list of security group IDs to associate with EC2 instances launched by the capacity provider.
-
#subnets ⇒ Array<AWSCDK::EC2::ISubnet>
readonly
A list of subnets where the capacity provider can launch EC2 instances.
Class Method Summary collapse
Instance Method Summary collapse
-
#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
constructor
A new instance of CapacityProviderProps.
- #to_jsii ⇒ Object
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.
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 = Jsii::Type.check_type(@scaling_options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbGFtYmRhLlNjYWxpbmdPcHRpb25zIn0=")), "scalingOptions") unless @scaling_options.nil? end |
Instance Attribute Details
#architectures ⇒ Array<AWSCDK::Lambda::Architecture>? (readonly)
Default: - No architecture constraints specified
The instruction set architecture required for compute instances.
Only one architecture can be specified per capacity provider.
55 56 57 |
# File 'lambda/capacity_provider_props.rb', line 55 def architectures @architectures end |
#capacity_provider_name ⇒ String? (readonly)
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.
62 63 64 |
# File 'lambda/capacity_provider_props.rb', line 62 def capacity_provider_name @capacity_provider_name end |
#instance_type_filter ⇒ AWSCDK::Lambda::InstanceTypeFilter? (readonly)
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_key ⇒ AWSCDK::KMS::IKey? (readonly)
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.
72 73 74 |
# File 'lambda/capacity_provider_props.rb', line 72 def kms_key @kms_key end |
#max_v_cpu_count ⇒ Numeric? (readonly)
Default: - No maximum limit specified, service default is 400
The maximum number of vCPUs that the capacity provider can scale up to.
77 78 79 |
# File 'lambda/capacity_provider_props.rb', line 77 def max_v_cpu_count @max_v_cpu_count end |
#operator_role ⇒ AWSCDK::IAM::IRole? (readonly)
Default: - A role will be generated containing the AWSLambdaManagedEC2ResourceOperator managed policy
The IAM role that the Lambda service assumes to manage the capacity provider.
82 83 84 |
# File 'lambda/capacity_provider_props.rb', line 82 def operator_role @operator_role end |
#scaling_options ⇒ AWSCDK::Lambda::ScalingOptions? (readonly)
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 end |
#security_groups ⇒ Array<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.
42 43 44 |
# File 'lambda/capacity_provider_props.rb', line 42 def security_groups @security_groups end |
#subnets ⇒ Array<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.
48 49 50 |
# File 'lambda/capacity_provider_props.rb', line 48 def subnets @subnets end |
Class Method Details
.jsii_properties ⇒ Object
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_jsii ⇒ Object
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 |