CfnInfrastructureConfigurationPropsMixin

class aws_cdk.mixins_preview.aws_imagebuilder.mixins.CfnInfrastructureConfigurationPropsMixin(props, *, strategy=None)

Bases: Mixin

Creates a new infrastructure configuration.

An infrastructure configuration defines the environment in which your image will be built and tested.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-imagebuilder-infrastructureconfiguration.html

CloudformationResource:

AWS::ImageBuilder::InfrastructureConfiguration

Mixin:

true

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview import mixins
from aws_cdk.mixins_preview.aws_imagebuilder import mixins as imagebuilder_mixins

cfn_infrastructure_configuration_props_mixin = imagebuilder_mixins.CfnInfrastructureConfigurationPropsMixin(imagebuilder_mixins.CfnInfrastructureConfigurationMixinProps(
    description="description",
    instance_metadata_options=imagebuilder_mixins.CfnInfrastructureConfigurationPropsMixin.InstanceMetadataOptionsProperty(
        http_put_response_hop_limit=123,
        http_tokens="httpTokens"
    ),
    instance_profile_name="instanceProfileName",
    instance_types=["instanceTypes"],
    key_pair="keyPair",
    logging=imagebuilder_mixins.CfnInfrastructureConfigurationPropsMixin.LoggingProperty(
        s3_logs=imagebuilder_mixins.CfnInfrastructureConfigurationPropsMixin.S3LogsProperty(
            s3_bucket_name="s3BucketName",
            s3_key_prefix="s3KeyPrefix"
        )
    ),
    name="name",
    placement=imagebuilder_mixins.CfnInfrastructureConfigurationPropsMixin.PlacementProperty(
        availability_zone="availabilityZone",
        host_id="hostId",
        host_resource_group_arn="hostResourceGroupArn",
        tenancy="tenancy"
    ),
    resource_tags={
        "resource_tags_key": "resourceTags"
    },
    security_group_ids=["securityGroupIds"],
    sns_topic_arn="snsTopicArn",
    subnet_id="subnetId",
    tags={
        "tags_key": "tags"
    },
    terminate_instance_on_failure=False
),
    strategy=mixins.PropertyMergeStrategy.OVERRIDE
)

Create a mixin to apply properties to AWS::ImageBuilder::InfrastructureConfiguration.

Parameters:

Methods

apply_to(construct)

Apply the mixin properties to the construct.

Parameters:

construct (IConstruct)

Return type:

IConstruct

supports(construct)

Check if this mixin supports the given construct.

Parameters:

construct (IConstruct)

Return type:

bool

Attributes

CFN_PROPERTY_KEYS = ['description', 'instanceMetadataOptions', 'instanceProfileName', 'instanceTypes', 'keyPair', 'logging', 'name', 'placement', 'resourceTags', 'securityGroupIds', 'snsTopicArn', 'subnetId', 'tags', 'terminateInstanceOnFailure']

Static Methods

classmethod is_mixin(x)

(experimental) Checks if x is a Mixin.

Parameters:

x (Any) – Any object.

Return type:

bool

Returns:

true if x is an object created from a class which extends Mixin.

Stability:

experimental

InstanceMetadataOptionsProperty

class CfnInfrastructureConfigurationPropsMixin.InstanceMetadataOptionsProperty(*, http_put_response_hop_limit=None, http_tokens=None)

Bases: object

The instance metadata options that apply to the HTTP requests that pipeline builds use to launch EC2 build and test instances.

For more information about instance metadata options, see Configure the instance metadata options in the Amazon EC2 User Guide for Linux instances, or Configure the instance metadata options in the Amazon EC2 Windows Guide for Windows instances.

Parameters:
  • http_put_response_hop_limit (Union[int, float, None]) – Limit the number of hops that an instance metadata request can traverse to reach its destination. The default is one hop. However, if HTTP tokens are required, container image builds need a minimum of two hops.

  • http_tokens (Optional[str]) – Indicates whether a signed token header is required for instance metadata retrieval requests. The values affect the response as follows: - required – When you retrieve the IAM role credentials, version 2.0 credentials are returned in all cases. - optional – You can include a signed token header in your request to retrieve instance metadata, or you can leave it out. If you include it, version 2.0 credentials are returned for the IAM role. Otherwise, version 1.0 credentials are returned. The default setting is optional .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-imagebuilder-infrastructureconfiguration-instancemetadataoptions.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_imagebuilder import mixins as imagebuilder_mixins

instance_metadata_options_property = imagebuilder_mixins.CfnInfrastructureConfigurationPropsMixin.InstanceMetadataOptionsProperty(
    http_put_response_hop_limit=123,
    http_tokens="httpTokens"
)

Attributes

http_put_response_hop_limit

Limit the number of hops that an instance metadata request can traverse to reach its destination.

The default is one hop. However, if HTTP tokens are required, container image builds need a minimum of two hops.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-imagebuilder-infrastructureconfiguration-instancemetadataoptions.html#cfn-imagebuilder-infrastructureconfiguration-instancemetadataoptions-httpputresponsehoplimit

http_tokens

Indicates whether a signed token header is required for instance metadata retrieval requests.

The values affect the response as follows:

  • required – When you retrieve the IAM role credentials, version 2.0 credentials are returned in all cases.

  • optional – You can include a signed token header in your request to retrieve instance metadata, or you can leave it out. If you include it, version 2.0 credentials are returned for the IAM role. Otherwise, version 1.0 credentials are returned.

The default setting is optional .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-imagebuilder-infrastructureconfiguration-instancemetadataoptions.html#cfn-imagebuilder-infrastructureconfiguration-instancemetadataoptions-httptokens

LoggingProperty

class CfnInfrastructureConfigurationPropsMixin.LoggingProperty(*, s3_logs=None)

Bases: object

Logging configuration defines where Image Builder uploads your logs.

Parameters:

s3_logs (Union[IResolvable, S3LogsProperty, Dict[str, Any], None]) – The Amazon S3 logging configuration.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-imagebuilder-infrastructureconfiguration-logging.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_imagebuilder import mixins as imagebuilder_mixins

logging_property = imagebuilder_mixins.CfnInfrastructureConfigurationPropsMixin.LoggingProperty(
    s3_logs=imagebuilder_mixins.CfnInfrastructureConfigurationPropsMixin.S3LogsProperty(
        s3_bucket_name="s3BucketName",
        s3_key_prefix="s3KeyPrefix"
    )
)

Attributes

s3_logs

The Amazon S3 logging configuration.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-imagebuilder-infrastructureconfiguration-logging.html#cfn-imagebuilder-infrastructureconfiguration-logging-s3logs

PlacementProperty

class CfnInfrastructureConfigurationPropsMixin.PlacementProperty(*, availability_zone=None, host_id=None, host_resource_group_arn=None, tenancy=None)

Bases: object

By default, EC2 instances run on shared tenancy hardware.

This means that multiple AWS accounts might share the same physical hardware. When you use dedicated hardware, the physical server that hosts your instances is dedicated to your AWS account . Instance placement settings contain the details for the physical hardware where instances that Image Builder launches during image creation will run.

Parameters:
  • availability_zone (Optional[str]) – The Availability Zone where your build and test instances will launch.

  • host_id (Optional[str]) – The ID of the Dedicated Host on which build and test instances run. This only applies if tenancy is host . If you specify the host ID, you must not specify the resource group ARN. If you specify both, Image Builder returns an error.

  • host_resource_group_arn (Optional[str]) – The Amazon Resource Name (ARN) of the host resource group in which to launch build and test instances. This only applies if tenancy is host . If you specify the resource group ARN, you must not specify the host ID. If you specify both, Image Builder returns an error.

  • tenancy (Optional[str]) – The tenancy of the instance. An instance with a tenancy of dedicated runs on single-tenant hardware. An instance with a tenancy of host runs on a Dedicated Host. If tenancy is set to host , then you can optionally specify one target for placement – either host ID or host resource group ARN. If automatic placement is enabled for your host, and you don’t specify any placement target, Amazon EC2 will try to find an available host for your build and test instances.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-imagebuilder-infrastructureconfiguration-placement.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_imagebuilder import mixins as imagebuilder_mixins

placement_property = imagebuilder_mixins.CfnInfrastructureConfigurationPropsMixin.PlacementProperty(
    availability_zone="availabilityZone",
    host_id="hostId",
    host_resource_group_arn="hostResourceGroupArn",
    tenancy="tenancy"
)

Attributes

availability_zone

The Availability Zone where your build and test instances will launch.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-imagebuilder-infrastructureconfiguration-placement.html#cfn-imagebuilder-infrastructureconfiguration-placement-availabilityzone

host_id

The ID of the Dedicated Host on which build and test instances run.

This only applies if tenancy is host . If you specify the host ID, you must not specify the resource group ARN. If you specify both, Image Builder returns an error.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-imagebuilder-infrastructureconfiguration-placement.html#cfn-imagebuilder-infrastructureconfiguration-placement-hostid

host_resource_group_arn

The Amazon Resource Name (ARN) of the host resource group in which to launch build and test instances.

This only applies if tenancy is host . If you specify the resource group ARN, you must not specify the host ID. If you specify both, Image Builder returns an error.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-imagebuilder-infrastructureconfiguration-placement.html#cfn-imagebuilder-infrastructureconfiguration-placement-hostresourcegrouparn

tenancy

The tenancy of the instance.

An instance with a tenancy of dedicated runs on single-tenant hardware. An instance with a tenancy of host runs on a Dedicated Host.

If tenancy is set to host , then you can optionally specify one target for placement – either host ID or host resource group ARN. If automatic placement is enabled for your host, and you don’t specify any placement target, Amazon EC2 will try to find an available host for your build and test instances.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-imagebuilder-infrastructureconfiguration-placement.html#cfn-imagebuilder-infrastructureconfiguration-placement-tenancy

S3LogsProperty

class CfnInfrastructureConfigurationPropsMixin.S3LogsProperty(*, s3_bucket_name=None, s3_key_prefix=None)

Bases: object

Amazon S3 logging configuration.

Parameters:
  • s3_bucket_name (Optional[str]) – The S3 bucket in which to store the logs.

  • s3_key_prefix (Optional[str]) – The Amazon S3 path to the bucket where the logs are stored.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-imagebuilder-infrastructureconfiguration-s3logs.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_imagebuilder import mixins as imagebuilder_mixins

s3_logs_property = imagebuilder_mixins.CfnInfrastructureConfigurationPropsMixin.S3LogsProperty(
    s3_bucket_name="s3BucketName",
    s3_key_prefix="s3KeyPrefix"
)

Attributes

s3_bucket_name

The S3 bucket in which to store the logs.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-imagebuilder-infrastructureconfiguration-s3logs.html#cfn-imagebuilder-infrastructureconfiguration-s3logs-s3bucketname

s3_key_prefix

The Amazon S3 path to the bucket where the logs are stored.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-imagebuilder-infrastructureconfiguration-s3logs.html#cfn-imagebuilder-infrastructureconfiguration-s3logs-s3keyprefix