DistributionConfigurationProps
- class aws_cdk.aws_imagebuilder_alpha.DistributionConfigurationProps(*, ami_distributions=None, container_distributions=None, description=None, distribution_configuration_name=None, tags=None)
Bases:
object(experimental) Properties for creating a Distribution Configuration resource.
- Parameters:
ami_distributions (
Optional[Sequence[Union[AmiDistribution,Dict[str,Any]]]]) – (experimental) The list of target regions and associated AMI distribution settings where the built AMI will be distributed. AMI distributions may also be added with theaddAmiDistributionsmethod. Default: None if container distributions are provided. Otherwise, at least one AMI or container distribution must be providedcontainer_distributions (
Optional[Sequence[Union[ContainerDistribution,Dict[str,Any]]]]) – (experimental) The list of target regions and associated container distribution settings where the built container will be distributed. Container distributions may also be added with theaddContainerDistributionsmethod. Default: None if AMI distributions are provided. Otherwise, at least one AMI or container distribution must be provideddescription (
Optional[str]) – (experimental) The description of the distribution configuration. Default: Nonedistribution_configuration_name (
Optional[str]) – (experimental) The name of the distribution configuration. Default: A name is generatedtags (
Optional[Mapping[str,str]]) – (experimental) The tags to apply to the distribution configuration. Default: None
- Stability:
experimental
- ExampleMetadata:
infused
Example:
distribution_configuration = imagebuilder.DistributionConfiguration(self, "DistributionConfiguration", distribution_configuration_name="test-distribution-configuration", description="A Distribution Configuration", ami_distributions=[imagebuilder.AmiDistribution( # Distribute AMI to us-east-2 and publish the AMI ID to an SSM parameter region="us-east-2", ssm_parameters=[imagebuilder.SSMParameterConfigurations( parameter=ssm.StringParameter.from_string_parameter_attributes(self, "CrossRegionParameter", parameter_name="/imagebuilder/ami", force_dynamic_reference=True ) ) ] ) ] ) # For AMI-based image builds - add an AMI distribution in the current region distribution_configuration.add_ami_distributions( ami_name="imagebuilder-{{ imagebuilder:buildDate }}", ami_description="Build AMI", ami_kms_key=kms.Key.from_lookup(self, "ComponentKey", alias_name="alias/distribution-encryption-key"), # Copy the AMI to different accounts ami_target_account_ids=["123456789012", "098765432109"], # Add launch permissions on the AMI ami_launch_permission=imagebuilder.AmiLaunchPermission( organization_arns=[ self.format_arn(region="", service="organizations", resource="organization", resource_name="o-1234567abc") ], organizational_unit_arns=[ self.format_arn( region="", service="organizations", resource="ou", resource_name="o-1234567abc/ou-a123-b4567890" ) ], is_public_user_group=True, account_ids=["234567890123"] ), # Attach tags to the AMI ami_tags={ "Environment": "production", "Version": "{{ imagebuilder:buildVersion }}" }, # Optional - publish the distributed AMI ID to an SSM parameter ssm_parameters=[imagebuilder.SSMParameterConfigurations( parameter=ssm.StringParameter.from_string_parameter_attributes(self, "Parameter", parameter_name="/imagebuilder/ami", force_dynamic_reference=True ) ), imagebuilder.SSMParameterConfigurations( ami_account="098765432109", data_type=ssm.ParameterDataType.TEXT, parameter=ssm.StringParameter.from_string_parameter_attributes(self, "CrossAccountParameter", parameter_name="imagebuilder-prod-ami", force_dynamic_reference=True ) ) ], # Optional - create a new launch template version with the distributed AMI ID launch_templates=[imagebuilder.LaunchTemplateConfiguration( launch_template=ec2.LaunchTemplate.from_launch_template_attributes(self, "LaunchTemplate", launch_template_id="lt-1234" ), set_default_version=True ), imagebuilder.LaunchTemplateConfiguration( account_id="123456789012", launch_template=ec2.LaunchTemplate.from_launch_template_attributes(self, "CrossAccountLaunchTemplate", launch_template_id="lt-5678" ), set_default_version=True ) ], # Optional - enable Fast Launch on an imported launch template fast_launch_configurations=[imagebuilder.FastLaunchConfiguration( enabled=True, launch_template=ec2.LaunchTemplate.from_launch_template_attributes(self, "FastLaunchLT", launch_template_name="fast-launch-lt" ), max_parallel_launches=10, target_snapshot_count=2 ) ], # Optional - license configurations to apply to the AMI license_configuration_arns=["arn:aws:license-manager:us-west-2:123456789012:license-configuration:lic-abcdefghijklmnopqrstuvwxyz" ] )
Attributes
- ami_distributions
(experimental) The list of target regions and associated AMI distribution settings where the built AMI will be distributed.
AMI distributions may also be added with the
addAmiDistributionsmethod.- Default:
None if container distributions are provided. Otherwise, at least one AMI or container distribution must be provided
- Stability:
experimental
- container_distributions
(experimental) The list of target regions and associated container distribution settings where the built container will be distributed.
Container distributions may also be added with the
addContainerDistributionsmethod.- Default:
None if AMI distributions are provided. Otherwise, at least one AMI or container distribution must be provided
- Stability:
experimental
- description
(experimental) The description of the distribution configuration.
- Default:
None
- Stability:
experimental
- distribution_configuration_name
(experimental) The name of the distribution configuration.
- Default:
A name is generated
- Stability:
experimental
- tags
(experimental) The tags to apply to the distribution configuration.
- Default:
None
- Stability:
experimental