Class: AWSCDK::EKS::FargateProfileOptions
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::EKS::FargateProfileOptions
- Defined in:
- eks/fargate_profile_options.rb
Overview
Options for defining EKS Fargate Profiles.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#fargate_profile_name ⇒ String?
readonly
The name of the Fargate profile.
-
#pod_execution_role ⇒ AWSCDK::IAM::IRole?
readonly
The pod execution role to use for pods that match the selectors in the Fargate profile.
-
#removal_policy ⇒ AWSCDK::RemovalPolicy?
readonly
The removal policy applied to the custom resource that manages the Fargate profile.
-
#selectors ⇒ Array<AWSCDK::EKS::Selector>
readonly
The selectors to match for pods to use this Fargate profile.
-
#subnet_selection ⇒ AWSCDK::EC2::SubnetSelection?
readonly
Select which subnets to launch your pods into.
-
#vpc ⇒ AWSCDK::EC2::IVPC?
readonly
The VPC from which to select subnets to launch your pods into.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(selectors:, fargate_profile_name: nil, pod_execution_role: nil, removal_policy: nil, subnet_selection: nil, vpc: nil) ⇒ FargateProfileOptions
constructor
A new instance of FargateProfileOptions.
- #to_jsii ⇒ Object
Constructor Details
#initialize(selectors:, fargate_profile_name: nil, pod_execution_role: nil, removal_policy: nil, subnet_selection: nil, vpc: nil) ⇒ FargateProfileOptions
Returns a new instance of FargateProfileOptions.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'eks/fargate_profile_options.rb', line 13 def initialize(selectors:, fargate_profile_name: nil, pod_execution_role: nil, removal_policy: nil, subnet_selection: nil, vpc: nil) @selectors = selectors.is_a?(Array) ? selectors.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::EKS::Selector.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : selectors Jsii::Type.check_type(@selectors, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19la3MuU2VsZWN0b3IifSwia2luZCI6ImFycmF5In19")), "selectors") @fargate_profile_name = fargate_profile_name Jsii::Type.check_type(@fargate_profile_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "fargateProfileName") unless @fargate_profile_name.nil? @pod_execution_role = pod_execution_role Jsii::Type.check_type(@pod_execution_role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklSb2xlIn0=")), "podExecutionRole") unless @pod_execution_role.nil? @removal_policy = removal_policy Jsii::Type.check_type(@removal_policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZW1vdmFsUG9saWN5In0=")), "removalPolicy") unless @removal_policy.nil? @subnet_selection = subnet_selection.is_a?(Hash) ? ::AWSCDK::EC2::SubnetSelection.new(**subnet_selection.transform_keys(&:to_sym)) : subnet_selection Jsii::Type.check_type(@subnet_selection, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLlN1Ym5ldFNlbGVjdGlvbiJ9")), "subnetSelection") unless @subnet_selection.nil? @vpc = vpc Jsii::Type.check_type(@vpc, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLklWcGMifQ==")), "vpc") unless @vpc.nil? end |
Instance Attribute Details
#fargate_profile_name ⇒ String? (readonly)
Default: - generated
The name of the Fargate profile.
42 43 44 |
# File 'eks/fargate_profile_options.rb', line 42 def fargate_profile_name @fargate_profile_name end |
#pod_execution_role ⇒ AWSCDK::IAM::IRole? (readonly)
Default: - a role will be automatically created
The pod execution role to use for pods that match the selectors in the Fargate profile.
The pod execution role allows Fargate infrastructure to register with your cluster as a node, and it provides read access to Amazon ECR image repositories.
52 53 54 |
# File 'eks/fargate_profile_options.rb', line 52 def pod_execution_role @pod_execution_role end |
#removal_policy ⇒ AWSCDK::RemovalPolicy? (readonly)
Default: RemovalPolicy.DESTROY
The removal policy applied to the custom resource that manages the Fargate profile.
The removal policy controls what happens to the resource if it stops being managed by CloudFormation. This can happen in one of three situations:
- The resource is removed from the template, so CloudFormation stops managing it
- A change to the resource is made that requires it to be replaced, so CloudFormation stops managing it
- The stack is deleted, so CloudFormation stops managing all resources in it
64 65 66 |
# File 'eks/fargate_profile_options.rb', line 64 def removal_policy @removal_policy end |
#selectors ⇒ Array<AWSCDK::EKS::Selector> (readonly)
The selectors to match for pods to use this Fargate profile.
Each selector must have an associated namespace. Optionally, you can also specify labels for a namespace.
At least one selector is required and you may specify up to five selectors.
37 38 39 |
# File 'eks/fargate_profile_options.rb', line 37 def selectors @selectors end |
#subnet_selection ⇒ AWSCDK::EC2::SubnetSelection? (readonly)
Default: - all private subnets of the VPC are selected.
Select which subnets to launch your pods into.
At this time, pods running on Fargate are not assigned public IP addresses, so only private subnets (with no direct route to an Internet Gateway) are allowed.
You must specify the VPC to customize the subnet selection
75 76 77 |
# File 'eks/fargate_profile_options.rb', line 75 def subnet_selection @subnet_selection end |
#vpc ⇒ AWSCDK::EC2::IVPC? (readonly)
Default: - all private subnets used by the EKS cluster
The VPC from which to select subnets to launch your pods into.
By default, all private subnets are selected. You can customize this using
subnet_selection.
83 84 85 |
# File 'eks/fargate_profile_options.rb', line 83 def vpc @vpc end |
Class Method Details
.jsii_properties ⇒ Object
85 86 87 88 89 90 91 92 93 94 |
# File 'eks/fargate_profile_options.rb', line 85 def self.jsii_properties { :selectors => "selectors", :fargate_profile_name => "fargateProfileName", :pod_execution_role => "podExecutionRole", :removal_policy => "removalPolicy", :subnet_selection => "subnetSelection", :vpc => "vpc", } end |
Instance Method Details
#to_jsii ⇒ Object
96 97 98 99 100 101 102 103 104 105 106 107 |
# File 'eks/fargate_profile_options.rb', line 96 def to_jsii result = {} result.merge!({ "selectors" => @selectors, "fargateProfileName" => @fargate_profile_name, "podExecutionRole" => @pod_execution_role, "removalPolicy" => @removal_policy, "subnetSelection" => @subnet_selection, "vpc" => @vpc, }) result.compact end |