Class: AWSCDK::ECS::CfnCapacityProvider::ManagedInstancesProviderProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
ecs/cfn_capacity_provider.rb

Overview

The configuration for a Amazon ECS Managed Instances provider.

Amazon ECS uses this configuration to automatically launch, manage, and terminate Amazon EC2 instances on your behalf. Managed instances provide access to the full range of Amazon EC2 instance types and features while offloading infrastructure management to AWS .

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(infrastructure_role_arn:, instance_launch_template:, auto_repair_configuration: nil, infrastructure_optimization: nil, propagate_tags: nil) ⇒ ManagedInstancesProviderProperty

Returns a new instance of ManagedInstancesProviderProperty.

Parameters:



1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
# File 'ecs/cfn_capacity_provider.rb', line 1443

def initialize(infrastructure_role_arn:, instance_launch_template:, auto_repair_configuration: nil, infrastructure_optimization: nil, propagate_tags: nil)
  @infrastructure_role_arn = infrastructure_role_arn
  Jsii::Type.check_type(@infrastructure_role_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "infrastructureRoleArn")
  @instance_launch_template = instance_launch_template.is_a?(Hash) ? ::AWSCDK::ECS::CfnCapacityProvider::InstanceLaunchTemplateProperty.new(**instance_launch_template.transform_keys(&:to_sym)) : instance_launch_template
  Jsii::Type.check_type(@instance_launch_template, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lY3MuQ2ZuQ2FwYWNpdHlQcm92aWRlci5JbnN0YW5jZUxhdW5jaFRlbXBsYXRlUHJvcGVydHkifV19fQ==")), "instanceLaunchTemplate")
  @auto_repair_configuration = auto_repair_configuration.is_a?(Hash) ? ::AWSCDK::ECS::CfnCapacityProvider::AutoRepairConfigurationProperty.new(**auto_repair_configuration.transform_keys(&:to_sym)) : auto_repair_configuration
  Jsii::Type.check_type(@auto_repair_configuration, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lY3MuQ2ZuQ2FwYWNpdHlQcm92aWRlci5BdXRvUmVwYWlyQ29uZmlndXJhdGlvblByb3BlcnR5In1dfX0=")), "autoRepairConfiguration") unless @auto_repair_configuration.nil?
  @infrastructure_optimization = infrastructure_optimization.is_a?(Hash) ? ::AWSCDK::ECS::CfnCapacityProvider::InfrastructureOptimizationProperty.new(**infrastructure_optimization.transform_keys(&:to_sym)) : infrastructure_optimization
  Jsii::Type.check_type(@infrastructure_optimization, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lY3MuQ2ZuQ2FwYWNpdHlQcm92aWRlci5JbmZyYXN0cnVjdHVyZU9wdGltaXphdGlvblByb3BlcnR5In1dfX0=")), "infrastructureOptimization") unless @infrastructure_optimization.nil?
  @propagate_tags = propagate_tags
  Jsii::Type.check_type(@propagate_tags, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "propagateTags") unless @propagate_tags.nil?
end

Instance Attribute Details

#auto_repair_configurationAWSCDK::IResolvable, ... (readonly)



1476
1477
1478
# File 'ecs/cfn_capacity_provider.rb', line 1476

def auto_repair_configuration
  @auto_repair_configuration
end

#infrastructure_optimizationAWSCDK::IResolvable, ... (readonly)

Defines how Amazon ECS Managed Instances optimizes the infrastastructure in your capacity provider.

Configure it to turn on or off the infrastructure optimization in your capacity provider, and to control the idle or underutilized EC2 instances optimization delay.



1483
1484
1485
# File 'ecs/cfn_capacity_provider.rb', line 1483

def infrastructure_optimization
  @infrastructure_optimization
end

#infrastructure_role_arnString (readonly)

The Amazon Resource Name (ARN) of the infrastructure role that Amazon ECS assumes to manage instances.

This role must include permissions for Amazon EC2 instance lifecycle management, networking, and any additional AWS services required for your workloads.

For more information, see Amazon ECS infrastructure IAM role in the Amazon ECS Developer Guide .



1464
1465
1466
# File 'ecs/cfn_capacity_provider.rb', line 1464

def infrastructure_role_arn
  @infrastructure_role_arn
end

#instance_launch_templateAWSCDK::IResolvable, AWSCDK::ECS::CfnCapacityProvider::InstanceLaunchTemplateProperty (readonly)

The launch template that defines how Amazon ECS launches Amazon ECS Managed Instances.

This includes the instance profile for your tasks, network and storage configuration, and instance requirements that determine which Amazon EC2 instance types can be used.

For more information, see Store instance launch parameters in Amazon EC2 launch templates in the Amazon EC2 User Guide .



1473
1474
1475
# File 'ecs/cfn_capacity_provider.rb', line 1473

def instance_launch_template
  @instance_launch_template
end

#propagate_tagsString? (readonly)

Determines whether tags from the capacity provider are automatically applied to Amazon ECS Managed Instances.

This helps with cost allocation and resource management by ensuring consistent tagging across your infrastructure.



1490
1491
1492
# File 'ecs/cfn_capacity_provider.rb', line 1490

def propagate_tags
  @propagate_tags
end

Class Method Details

.jsii_propertiesObject



1492
1493
1494
1495
1496
1497
1498
1499
1500
# File 'ecs/cfn_capacity_provider.rb', line 1492

def self.jsii_properties
  {
    :infrastructure_role_arn => "infrastructureRoleArn",
    :instance_launch_template => "instanceLaunchTemplate",
    :auto_repair_configuration => "autoRepairConfiguration",
    :infrastructure_optimization => "infrastructureOptimization",
    :propagate_tags => "propagateTags",
  }
end

Instance Method Details

#to_jsiiObject



1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
# File 'ecs/cfn_capacity_provider.rb', line 1502

def to_jsii
  result = {}
  result.merge!({
    "infrastructureRoleArn" => @infrastructure_role_arn,
    "instanceLaunchTemplate" => @instance_launch_template,
    "autoRepairConfiguration" => @auto_repair_configuration,
    "infrastructureOptimization" => @infrastructure_optimization,
    "propagateTags" => @propagate_tags,
  })
  result.compact
end