Skip to content
v2.277.0

CfnInfrastructureConfigurationProps Struct ​

Properties for defining a CfnInfrastructureConfiguration.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_imagebuilder as imagebuilder } from 'aws-cdk-lib';
const cfnInfrastructureConfigurationProps: imagebuilder.CfnInfrastructureConfigurationProps = {
  instanceProfileName: 'instanceProfileName',
  name: 'name',

  // the properties below are optional
  description: 'description',
  instanceMetadataOptions: {
    httpPutResponseHopLimit: 123,
    httpTokens: 'httpTokens',
  },
  instanceTypes: ['instanceTypes'],
  keyPair: 'keyPair',
  logging: {
    s3Logs: {
      s3BucketName: 's3BucketName',
      s3KeyPrefix: 's3KeyPrefix',
    },
  },
  parentInstance: {
    autoScalingGroup: {
      name: 'name',

      // the properties below are optional
      capacityWaitTimeoutSeconds: 123,
    },
  },
  placement: {
    availabilityZone: 'availabilityZone',
    hostId: 'hostId',
    hostResourceGroupArn: 'hostResourceGroupArn',
    tenancy: 'tenancy',
  },
  resourceTags: {
    resourceTagsKey: 'resourceTags',
  },
  securityGroupIds: ['securityGroupIds'],
  snsTopicArn: 'snsTopicArn',
  subnetId: 'subnetId',
  tags: {
    tagsKey: 'tags',
  },
  terminateInstanceOnCompletion: false,
  terminateInstanceOnFailure: false,
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_imagebuilder as imagebuilder

cfn_infrastructure_configuration_props = imagebuilder.CfnInfrastructureConfigurationProps(
    instance_profile_name="instanceProfileName",
    name="name",

    # the properties below are optional
    description="description",
    instance_metadata_options=imagebuilder.CfnInfrastructureConfiguration.InstanceMetadataOptionsProperty(
        http_put_response_hop_limit=123,
        http_tokens="httpTokens"
    ),
    instance_types=["instanceTypes"],
    key_pair="keyPair",
    logging=imagebuilder.CfnInfrastructureConfiguration.LoggingProperty(
        s3_logs=imagebuilder.CfnInfrastructureConfiguration.S3LogsProperty(
            s3_bucket_name="s3BucketName",
            s3_key_prefix="s3KeyPrefix"
        )
    ),
    parent_instance=imagebuilder.CfnInfrastructureConfiguration.ParentInstanceProperty(
        auto_scaling_group=imagebuilder.CfnInfrastructureConfiguration.AutoScalingGroupProperty(
            name="name",

            # the properties below are optional
            capacity_wait_timeout_seconds=123
        )
    ),
    placement=imagebuilder.CfnInfrastructureConfiguration.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_completion=False,
    terminate_instance_on_failure=False
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.imagebuilder.*;

CfnInfrastructureConfigurationProps cfnInfrastructureConfigurationProps = CfnInfrastructureConfigurationProps.builder()
        .instanceProfileName("instanceProfileName")
        .name("name")

        // the properties below are optional
        .description("description")
        .instanceMetadataOptions(InstanceMetadataOptionsProperty.builder()
                .httpPutResponseHopLimit(123)
                .httpTokens("httpTokens")
                .build())
        .instanceTypes(List.of("instanceTypes"))
        .keyPair("keyPair")
        .logging(LoggingProperty.builder()
                .s3Logs(S3LogsProperty.builder()
                        .s3BucketName("s3BucketName")
                        .s3KeyPrefix("s3KeyPrefix")
                        .build())
                .build())
        .parentInstance(ParentInstanceProperty.builder()
                .autoScalingGroup(AutoScalingGroupProperty.builder()
                        .name("name")

                        // the properties below are optional
                        .capacityWaitTimeoutSeconds(123)
                        .build())
                .build())
        .placement(PlacementProperty.builder()
                .availabilityZone("availabilityZone")
                .hostId("hostId")
                .hostResourceGroupArn("hostResourceGroupArn")
                .tenancy("tenancy")
                .build())
        .resourceTags(Map.of(
                "resourceTagsKey", "resourceTags"))
        .securityGroupIds(List.of("securityGroupIds"))
        .snsTopicArn("snsTopicArn")
        .subnetId("subnetId")
        .tags(Map.of(
                "tagsKey", "tags"))
        .terminateInstanceOnCompletion(false)
        .terminateInstanceOnFailure(false)
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.ImageBuilder;

var cfnInfrastructureConfigurationProps = new CfnInfrastructureConfigurationProps {
    InstanceProfileName = "instanceProfileName",
    Name = "name",

    // the properties below are optional
    Description = "description",
    InstanceMetadataOptions = new InstanceMetadataOptionsProperty {
        HttpPutResponseHopLimit = 123,
        HttpTokens = "httpTokens"
    },
    InstanceTypes = new [] { "instanceTypes" },
    KeyPair = "keyPair",
    Logging = new LoggingProperty {
        S3Logs = new S3LogsProperty {
            S3BucketName = "s3BucketName",
            S3KeyPrefix = "s3KeyPrefix"
        }
    },
    ParentInstance = new ParentInstanceProperty {
        AutoScalingGroup = new AutoScalingGroupProperty {
            Name = "name",

            // the properties below are optional
            CapacityWaitTimeoutSeconds = 123
        }
    },
    Placement = new PlacementProperty {
        AvailabilityZone = "availabilityZone",
        HostId = "hostId",
        HostResourceGroupArn = "hostResourceGroupArn",
        Tenancy = "tenancy"
    },
    ResourceTags = new Dictionary<string, string> {
        { "resourceTagsKey", "resourceTags" }
    },
    SecurityGroupIds = new [] { "securityGroupIds" },
    SnsTopicArn = "snsTopicArn",
    SubnetId = "subnetId",
    Tags = new Dictionary<string, string> {
        { "tagsKey", "tags" }
    },
    TerminateInstanceOnCompletion = false,
    TerminateInstanceOnFailure = false
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnInfrastructureConfigurationProps := &CfnInfrastructureConfigurationProps{
	InstanceProfileName: jsii.String("instanceProfileName"),
	Name: jsii.String("name"),

	// the properties below are optional
	Description: jsii.String("description"),
	InstanceMetadataOptions: &InstanceMetadataOptionsProperty{
		HttpPutResponseHopLimit: jsii.Number(123),
		HttpTokens: jsii.String("httpTokens"),
	},
	InstanceTypes: []*string{
		jsii.String("instanceTypes"),
	},
	KeyPair: jsii.String("keyPair"),
	Logging: &LoggingProperty{
		S3Logs: &S3LogsProperty{
			S3BucketName: jsii.String("s3BucketName"),
			S3KeyPrefix: jsii.String("s3KeyPrefix"),
		},
	},
	ParentInstance: &ParentInstanceProperty{
		AutoScalingGroup: &AutoScalingGroupProperty{
			Name: jsii.String("name"),

			// the properties below are optional
			CapacityWaitTimeoutSeconds: jsii.Number(123),
		},
	},
	Placement: &PlacementProperty{
		AvailabilityZone: jsii.String("availabilityZone"),
		HostId: jsii.String("hostId"),
		HostResourceGroupArn: jsii.String("hostResourceGroupArn"),
		Tenancy: jsii.String("tenancy"),
	},
	ResourceTags: map[string]*string{
		"resourceTagsKey": jsii.String("resourceTags"),
	},
	SecurityGroupIds: []*string{
		jsii.String("securityGroupIds"),
	},
	SnsTopicArn: jsii.String("snsTopicArn"),
	SubnetId: jsii.String("subnetId"),
	Tags: map[string]*string{
		"tagsKey": jsii.String("tags"),
	},
	TerminateInstanceOnCompletion: jsii.Boolean(false),
	TerminateInstanceOnFailure: jsii.Boolean(false),
}

Properties ​

descriptionoptionalstringdescriptionoptionalstrdescriptionoptionalStringDescriptionoptionalstringDescriptionoptional*string #
The description of the infrastructure configuration.
instanceMetadataOptionsoptionalIResolvable | CfnInfrastructureConfiguration.InstanceMetadataOptionsPropertyinstance_metadata_optionsoptionaltyping.Union[IResolvable, InstanceMetadataOptionsProperty]instanceMetadataOptionsoptionalIResolvableInstanceMetadataOptionsoptionalIResolvableInstanceMetadataOptionsoptionalinterface{} #
The instance metadata options that you can set for the HTTP requests that pipeline builds use to launch EC2 build and test instances.
instanceProfileNamestring | IInstanceProfileRefinstance_profile_nametyping.Union[str, IInstanceProfileRef]instanceProfileNameStringInstanceProfileNamestringInstanceProfileNameinterface{} required #
The instance profile to associate with the instance used to customize your Amazon EC2 AMI.
instanceTypesoptionalstring[]instance_typesoptionaltyping.List[str]instanceTypesoptionalList<String>InstanceTypesoptionalstring[]InstanceTypesoptional*[]*string #
The instance types of the infrastructure configuration.

You can specify one or more instance types to use for this build. The service will pick one of these instance types based on availability.

keyPairoptionalstringkey_pairoptionalstrkeyPairoptionalStringKeyPairoptionalstringKeyPairoptional*string #
The key pair of the infrastructure configuration.

You can use this to log on to and debug the instance used to create your image.

loggingoptionalIResolvable | CfnInfrastructureConfiguration.LoggingPropertyloggingoptionaltyping.Union[IResolvable, LoggingProperty]loggingoptionalIResolvableLoggingoptionalIResolvableLoggingoptionalinterface{} #
The logging configuration of the infrastructure configuration.
namestringnamestrnameStringNamestringName*string required #
The name of the infrastructure configuration.
parentInstanceoptionalIResolvable | CfnInfrastructureConfiguration.ParentInstancePropertyparent_instanceoptionaltyping.Union[IResolvable, ParentInstanceProperty]parentInstanceoptionalIResolvableParentInstanceoptionalIResolvableParentInstanceoptionalinterface{} #
Settings for building on an instance that is already running, instead of an instance that Image Builder launches for the build.
placementoptionalIResolvable | CfnInfrastructureConfiguration.PlacementPropertyplacementoptionaltyping.Union[IResolvable, PlacementProperty]placementoptionalIResolvablePlacementoptionalIResolvablePlacementoptionalinterface{} #
The instance placement settings that define where the instances that are launched from your image will run.
resourceTagsoptionalIResolvable | { [key: string]: string }resource_tagsoptionaltyping.Union[IResolvable, typing.Mapping[str, str]]resourceTagsoptionalIResolvableResourceTagsoptionalIResolvableResourceTagsoptionalinterface{} #
The metadata tags to assign to the Amazon EC2 instance that Image Builder launches during the build process.

Tags are formatted as key value pairs.

securityGroupIdsoptionalstring[]security_group_idsoptionaltyping.List[str]securityGroupIdsoptionalList<String>SecurityGroupIdsoptionalstring[]SecurityGroupIdsoptional*[]*string #
The security group IDs to associate with the instance used to customize your Amazon EC2 AMI.
snsTopicArnoptionalstring | ITopicRefsns_topic_arnoptionaltyping.Union[str, ITopicRef]snsTopicArnoptionalStringSnsTopicArnoptionalstringSnsTopicArnoptionalinterface{} #
The Amazon Resource Name (ARN) for the SNS topic to which we send image build event notifications.

EC2 Image Builder is unable to send notifications to SNS topics that are encrypted using keys from other accounts. The key that is used to encrypt the SNS topic must reside in the account that the Image Builder service runs under.

subnetIdoptionalstringsubnet_idoptionalstrsubnetIdoptionalStringSubnetIdoptionalstringSubnetIdoptional*string #
The subnet ID in which to place the instance used to customize your Amazon EC2 AMI.
tagsoptional{ [key: string]: string }tagsoptionaltyping.Mapping[str, str]tagsoptionalMap<String, String>TagsoptionalIDictionary<string, string>Tagsoptional*map[string]*string #
The metadata tags to assign to the infrastructure configuration resource that Image Builder creates as output.

Tags are formatted as key value pairs.

terminateInstanceOnCompletionoptionalboolean | IResolvableterminate_instance_on_completionoptionaltyping.Union[bool, IResolvable]terminateInstanceOnCompletionoptionalBooleanTerminateInstanceOnCompletionoptionalboolTerminateInstanceOnCompletionoptionalinterface{} #
Specifies whether Image Builder terminates build and test instances that are still running when image creation ends without a failure.

A TerminateInstance step in a workflow runs even when this is false.

terminateInstanceOnFailureoptionalboolean | IResolvableterminate_instance_on_failureoptionaltyping.Union[bool, IResolvable]terminateInstanceOnFailureoptionalBooleanTerminateInstanceOnFailureoptionalboolTerminateInstanceOnFailureoptionalinterface{} #
The terminate instance on failure setting of the infrastructure configuration.

Set to false if you want Image Builder to retain the instance used to configure your AMI if the build or test phase of your workflow fails.