Class InfrastructureConfigurationProps.Builder
java.lang.Object
software.amazon.awscdk.services.imagebuilder.alpha.InfrastructureConfigurationProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<InfrastructureConfigurationProps>
- Enclosing interface:
InfrastructureConfigurationProps
@Stability(Experimental)
public static final class InfrastructureConfigurationProps.Builder
extends Object
implements software.amazon.jsii.Builder<InfrastructureConfigurationProps>
A builder for
InfrastructureConfigurationProps-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the configured instance.description(String description) Sets the value ofInfrastructureConfigurationProps.getDescription()ec2InstanceAvailabilityZone(String ec2InstanceAvailabilityZone) Sets the value ofInfrastructureConfigurationProps.getEc2InstanceAvailabilityZone()ec2InstanceHostId(String ec2InstanceHostId) Sets the value ofInfrastructureConfigurationProps.getEc2InstanceHostId()ec2InstanceHostResourceGroupArn(String ec2InstanceHostResourceGroupArn) Sets the value ofInfrastructureConfigurationProps.getEc2InstanceHostResourceGroupArn()ec2InstanceTenancy(Tenancy ec2InstanceTenancy) Sets the value ofInfrastructureConfigurationProps.getEc2InstanceTenancy()httpPutResponseHopLimit(Number httpPutResponseHopLimit) Sets the value ofInfrastructureConfigurationProps.getHttpPutResponseHopLimit()httpTokens(HttpTokens httpTokens) Sets the value ofInfrastructureConfigurationProps.getHttpTokens()infrastructureConfigurationName(String infrastructureConfigurationName) Sets the value ofInfrastructureConfigurationProps.getInfrastructureConfigurationName()instanceProfile(IInstanceProfile instanceProfile) Sets the value ofInfrastructureConfigurationProps.getInstanceProfile()instanceTypes(List<? extends InstanceType> instanceTypes) Sets the value ofInfrastructureConfigurationProps.getInstanceTypes()Sets the value ofInfrastructureConfigurationProps.getKeyPair()Sets the value ofInfrastructureConfigurationProps.getLogging()notificationTopic(ITopic notificationTopic) Sets the value ofInfrastructureConfigurationProps.getNotificationTopic()resourceTags(Map<String, String> resourceTags) Sets the value ofInfrastructureConfigurationProps.getResourceTags()Sets the value ofInfrastructureConfigurationProps.getRole()securityGroups(List<? extends ISecurityGroup> securityGroups) Sets the value ofInfrastructureConfigurationProps.getSecurityGroups()subnetSelection(SubnetSelection subnetSelection) Sets the value ofInfrastructureConfigurationProps.getSubnetSelection()Sets the value ofInfrastructureConfigurationProps.getTags()terminateInstanceOnFailure(Boolean terminateInstanceOnFailure) Sets the value ofInfrastructureConfigurationProps.getTerminateInstanceOnFailure()Sets the value ofInfrastructureConfigurationProps.getVpc()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
description
@Stability(Experimental) public InfrastructureConfigurationProps.Builder description(String description) Sets the value ofInfrastructureConfigurationProps.getDescription()- Parameters:
description- The description of the infrastructure configuration.- Returns:
this
-
ec2InstanceAvailabilityZone
@Stability(Experimental) public InfrastructureConfigurationProps.Builder ec2InstanceAvailabilityZone(String ec2InstanceAvailabilityZone) Sets the value ofInfrastructureConfigurationProps.getEc2InstanceAvailabilityZone()- Parameters:
ec2InstanceAvailabilityZone- The availability zone to place Image Builder build and test EC2 instances.- Returns:
this
-
ec2InstanceHostId
@Stability(Experimental) public InfrastructureConfigurationProps.Builder ec2InstanceHostId(String ec2InstanceHostId) Sets the value ofInfrastructureConfigurationProps.getEc2InstanceHostId()- Parameters:
ec2InstanceHostId- The ID of the Dedicated Host on which build and test instances run. This only applies if the instance tenancy ishost. This cannot be used with theec2InstanceHostResourceGroupArnparameter.- Returns:
this
-
ec2InstanceHostResourceGroupArn
@Stability(Experimental) public InfrastructureConfigurationProps.Builder ec2InstanceHostResourceGroupArn(String ec2InstanceHostResourceGroupArn) Sets the value ofInfrastructureConfigurationProps.getEc2InstanceHostResourceGroupArn()- Parameters:
ec2InstanceHostResourceGroupArn- The ARN of the host resource group on which build and test instances run. This only applies if the instance tenancy ishost. This cannot be used with theec2InstanceHostIdparameter.- Returns:
this
-
ec2InstanceTenancy
@Stability(Experimental) public InfrastructureConfigurationProps.Builder ec2InstanceTenancy(Tenancy ec2InstanceTenancy) Sets the value ofInfrastructureConfigurationProps.getEc2InstanceTenancy()- Parameters:
ec2InstanceTenancy- The tenancy of the instance. Dedicated tenancy runs instances on single-tenant hardware, while host tenancy runs instances on a dedicated host. Shared tenancy is used by default.- Returns:
this
-
httpPutResponseHopLimit
@Stability(Experimental) public InfrastructureConfigurationProps.Builder httpPutResponseHopLimit(Number httpPutResponseHopLimit) Sets the value ofInfrastructureConfigurationProps.getHttpPutResponseHopLimit()- Parameters:
httpPutResponseHopLimit- The maximum number of hops that an instance metadata request can traverse to reach its destination. By default, this is set to 2.- Returns:
this
-
httpTokens
@Stability(Experimental) public InfrastructureConfigurationProps.Builder httpTokens(HttpTokens httpTokens) Sets the value ofInfrastructureConfigurationProps.getHttpTokens()- Parameters:
httpTokens- Indicates whether a signed token header is required for instance metadata retrieval requests. By default, this is set torequiredto require IMDSv2 on build and test EC2 instances.- Returns:
this
-
infrastructureConfigurationName
@Stability(Experimental) public InfrastructureConfigurationProps.Builder infrastructureConfigurationName(String infrastructureConfigurationName) Sets the value ofInfrastructureConfigurationProps.getInfrastructureConfigurationName()- Parameters:
infrastructureConfigurationName- The name of the infrastructure configuration. This name must be normalized by transforming all alphabetical characters to lowercase, and replacing all spaces and underscores with hyphens.- Returns:
this
-
instanceProfile
@Stability(Experimental) public InfrastructureConfigurationProps.Builder instanceProfile(IInstanceProfile instanceProfile) Sets the value ofInfrastructureConfigurationProps.getInstanceProfile()- Parameters:
instanceProfile- The instance profile to associate with the instance used to customize the AMI. By default, an instance profile and role will be created with minimal permissions needed to build the image, attached to the EC2 instance.If an S3 logging bucket and key prefix is provided, an IAM inline policy will be attached to the instance profile's role, allowing s3:PutObject permissions on the bucket.
- Returns:
this
-
instanceTypes
@Stability(Experimental) public InfrastructureConfigurationProps.Builder instanceTypes(List<? extends InstanceType> instanceTypes) Sets the value ofInfrastructureConfigurationProps.getInstanceTypes()- Parameters:
instanceTypes- The instance types to launch build and test EC2 instances with.- Returns:
this
-
keyPair
Sets the value ofInfrastructureConfigurationProps.getKeyPair()- Parameters:
keyPair- The key pair used to connect to the build and test EC2 instances. The key pair can be used to log into the build or test instances for troubleshooting any failures.- Returns:
this
-
logging
@Stability(Experimental) public InfrastructureConfigurationProps.Builder logging(InfrastructureConfigurationLogging logging) Sets the value ofInfrastructureConfigurationProps.getLogging()- Parameters:
logging- The log settings for detailed build logging.- Returns:
this
-
notificationTopic
@Stability(Experimental) public InfrastructureConfigurationProps.Builder notificationTopic(ITopic notificationTopic) Sets the value ofInfrastructureConfigurationProps.getNotificationTopic()- Parameters:
notificationTopic- The SNS topic on which notifications are sent when an image build completes.- Returns:
this
-
resourceTags
@Stability(Experimental) public InfrastructureConfigurationProps.Builder resourceTags(Map<String, String> resourceTags) Sets the value ofInfrastructureConfigurationProps.getResourceTags()- Parameters:
resourceTags- The additional tags to assign to the Amazon EC2 instance that Image Builder launches during the build process.- Returns:
this
-
role
Sets the value ofInfrastructureConfigurationProps.getRole()- Parameters:
role- An IAM role to associate with the instance profile used by Image Builder. The role must be assumable by the service principalec2.amazonaws.com: Note: You can provide an instanceProfile or a role, but not both.- Returns:
this
-
securityGroups
@Stability(Experimental) public InfrastructureConfigurationProps.Builder securityGroups(List<? extends ISecurityGroup> securityGroups) Sets the value ofInfrastructureConfigurationProps.getSecurityGroups()- Parameters:
securityGroups- The security groups to associate with the instance used to customize the AMI.- Returns:
this
-
subnetSelection
@Stability(Experimental) public InfrastructureConfigurationProps.Builder subnetSelection(SubnetSelection subnetSelection) Sets the value ofInfrastructureConfigurationProps.getSubnetSelection()- Parameters:
subnetSelection- Select which subnet to place the instance used to customize the AMI. The first subnet that is selected will be used. You must specify the VPC to customize the subnet selection.- Returns:
this
-
tags
@Stability(Experimental) public InfrastructureConfigurationProps.Builder tags(Map<String, String> tags) Sets the value ofInfrastructureConfigurationProps.getTags()- Parameters:
tags- The tags to apply to the infrastructure configuration.- Returns:
this
-
terminateInstanceOnFailure
@Stability(Experimental) public InfrastructureConfigurationProps.Builder terminateInstanceOnFailure(Boolean terminateInstanceOnFailure) Sets the value ofInfrastructureConfigurationProps.getTerminateInstanceOnFailure()- Parameters:
terminateInstanceOnFailure- Whether to terminate the EC2 instance when the build or test workflow fails.- Returns:
this
-
vpc
Sets the value ofInfrastructureConfigurationProps.getVpc()- Parameters:
vpc- The VPC to place the instance used to customize the AMI.- Returns:
this
-
build
Builds the configured instance.- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<InfrastructureConfigurationProps>- Returns:
- a new instance of
InfrastructureConfigurationProps - Throws:
NullPointerException- if any required attribute was not provided
-