Class InfrastructureConfiguration
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.Resource
software.amazon.awscdk.services.imagebuilder.alpha.InfrastructureConfiguration
- All Implemented Interfaces:
IEnvironmentAware,IResource,IInfrastructureConfiguration,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.119.0 (build 1634eac)",
date="2025-11-13T16:10:18.394Z")
@Stability(Experimental)
public class InfrastructureConfiguration
extends Resource
implements IInfrastructureConfiguration
(experimental) Represents an EC2 Image Builder Infrastructure Configuration.
Example:
InfrastructureConfiguration infrastructureConfiguration = InfrastructureConfiguration.Builder.create(this, "InfrastructureConfiguration")
.infrastructureConfigurationName("test-infrastructure-configuration")
.description("An Infrastructure Configuration")
// Optional - instance types to use for build/test
.instanceTypes(List.of(InstanceType.of(InstanceClass.STANDARD7_INTEL, InstanceSize.LARGE), InstanceType.of(InstanceClass.BURSTABLE3, InstanceSize.LARGE)))
// Optional - create an instance profile with necessary permissions
.instanceProfile(InstanceProfile.Builder.create(this, "InstanceProfile")
.instanceProfileName("test-instance-profile")
.role(Role.Builder.create(this, "InstanceProfileRole")
.assumedBy(ServicePrincipal.fromStaticServicePrincipleName("ec2.amazonaws.com"))
.managedPolicies(List.of(ManagedPolicy.fromAwsManagedPolicyName("AmazonSSMManagedInstanceCore"), ManagedPolicy.fromAwsManagedPolicyName("EC2InstanceProfileForImageBuilder")))
.build())
.build())
// Use VPC network configuration
.vpc(vpc)
.subnetSelection(SubnetSelection.builder().subnetType(SubnetType.PUBLIC).build())
.securityGroups(List.of(SecurityGroup.fromSecurityGroupId(this, "SecurityGroup", vpc.getVpcDefaultSecurityGroup())))
.keyPair(KeyPair.fromKeyPairName(this, "KeyPair", "imagebuilder-instance-key-pair"))
.terminateInstanceOnFailure(true)
// Optional - IMDSv2 settings
.httpTokens(HttpTokens.REQUIRED)
.httpPutResponseHopLimit(1)
// Optional - publish image completion messages to an SNS topic
.notificationTopic(Topic.fromTopicArn(this, "Topic", this.formatArn(ArnComponents.builder().service("sns").resource("image-builder-topic").build())))
// Optional - log settings. Logging is enabled by default
.logging(InfrastructureConfigurationLogging.builder()
.s3Bucket(Bucket.fromBucketName(this, "LogBucket", String.format("imagebuilder-logging-%s", Aws.ACCOUNT_ID)))
.s3KeyPrefix("imagebuilder-logs")
.build())
// Optional - host placement settings
.ec2InstanceAvailabilityZone(Stack.of(this).getAvailabilityZones()[0])
.ec2InstanceHostId(dedicatedHost.getAttrHostId())
.ec2InstanceTenancy(Tenancy.HOST)
.resourceTags(Map.of(
"Environment", "production"))
.build();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class(experimental) A fluent builder forInfrastructureConfiguration.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.services.imagebuilder.alpha.IInfrastructureConfiguration
IInfrastructureConfiguration.Jsii$Default, IInfrastructureConfiguration.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.IResource
IResource.Jsii$Default -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String(experimental) Uniquely identifies this class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedInfrastructureConfiguration(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedInfrastructureConfiguration(software.amazon.jsii.JsiiObjectRef objRef) InfrastructureConfiguration(software.constructs.Construct scope, String id) InfrastructureConfiguration(software.constructs.Construct scope, String id, InfrastructureConfigurationProps props) -
Method Summary
Modifier and TypeMethodDescriptionstatic IInfrastructureConfigurationfromInfrastructureConfigurationArn(software.constructs.Construct scope, String id, String infrastructureConfigurationArn) (experimental) Import an existing infrastructure configuration given its ARN.static IInfrastructureConfigurationfromInfrastructureConfigurationName(software.constructs.Construct scope, String id, String infrastructureConfigurationName) (experimental) Import an existing infrastructure configuration given its name.(experimental) The ARN of the infrastructure configuration.(experimental) The name of the infrastructure configuration.(experimental) The EC2 instance profile to use for the build.(experimental) The bucket used to upload image build logs.getRole()(experimental) The role associated with the EC2 instance profile used for the build.grant(IGrantable grantee, String... actions) (experimental) Grant custom actions to the given grantee for the infrastructure configuration.grantRead(IGrantable grantee) (experimental) Grant read permissions to the given grantee for the infrastructure configuration.static Boolean(experimental) Return whether the given object is an InfrastructureConfiguration.Methods inherited from class software.amazon.awscdk.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResourceMethods inherited from class software.constructs.Construct
getNode, isConstruct, toStringMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.interfaces.IEnvironmentAware
getEnvMethods inherited from interface software.amazon.awscdk.IResource
applyRemovalPolicy, getStackMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
PROPERTY_INJECTION_ID
(experimental) Uniquely identifies this class.
-
-
Constructor Details
-
InfrastructureConfiguration
protected InfrastructureConfiguration(software.amazon.jsii.JsiiObjectRef objRef) -
InfrastructureConfiguration
protected InfrastructureConfiguration(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
InfrastructureConfiguration
@Stability(Experimental) public InfrastructureConfiguration(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable InfrastructureConfigurationProps props) - Parameters:
scope- This parameter is required.id- This parameter is required.props-
-
InfrastructureConfiguration
@Stability(Experimental) public InfrastructureConfiguration(@NotNull software.constructs.Construct scope, @NotNull String id) - Parameters:
scope- This parameter is required.id- This parameter is required.
-
-
Method Details
-
fromInfrastructureConfigurationArn
@Stability(Experimental) @NotNull public static IInfrastructureConfiguration fromInfrastructureConfigurationArn(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String infrastructureConfigurationArn) (experimental) Import an existing infrastructure configuration given its ARN.- Parameters:
scope- This parameter is required.id- This parameter is required.infrastructureConfigurationArn- This parameter is required.
-
fromInfrastructureConfigurationName
@Stability(Experimental) @NotNull public static IInfrastructureConfiguration fromInfrastructureConfigurationName(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String infrastructureConfigurationName) (experimental) Import an existing infrastructure configuration given its name.The provided name must be normalized by converting all alphabetical characters to lowercase, and replacing all spaces and underscores with hyphens.
- Parameters:
scope- This parameter is required.id- This parameter is required.infrastructureConfigurationName- This parameter is required.
-
isInfrastructureConfiguration
@Stability(Experimental) @NotNull public static Boolean isInfrastructureConfiguration(@NotNull Object x) (experimental) Return whether the given object is an InfrastructureConfiguration.- Parameters:
x- This parameter is required.
-
grant
@Stability(Experimental) @NotNull public Grant grant(@NotNull IGrantable grantee, @NotNull String... actions) (experimental) Grant custom actions to the given grantee for the infrastructure configuration.- Specified by:
grantin interfaceIInfrastructureConfiguration- Parameters:
grantee-- The principal.
actions-- The list of actions.
-
grantRead
(experimental) Grant read permissions to the given grantee for the infrastructure configuration.- Specified by:
grantReadin interfaceIInfrastructureConfiguration- Parameters:
grantee-- The principal.
-
getInfrastructureConfigurationArn
(experimental) The ARN of the infrastructure configuration.- Specified by:
getInfrastructureConfigurationArnin interfaceIInfrastructureConfiguration
-
getInfrastructureConfigurationName
(experimental) The name of the infrastructure configuration.- Specified by:
getInfrastructureConfigurationNamein interfaceIInfrastructureConfiguration
-
getInstanceProfile
(experimental) The EC2 instance profile to use for the build. -
getLogBucket
(experimental) The bucket used to upload image build logs. -
getRole
(experimental) The role associated with the EC2 instance profile used for the build.
-