java.lang.Object
java.lang.Enum<Tenancy>
software.amazon.awscdk.services.imagebuilder.alpha.Tenancy
All Implemented Interfaces:
Serializable, Comparable<Tenancy>, java.lang.constant.Constable

@Generated(value="jsii-pacmak/1.119.0 (build 1634eac)", date="2025-11-13T16:10:18.398Z") @Stability(Experimental) public enum Tenancy extends Enum<Tenancy>
(experimental) The tenancy to use for an instance.

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:
  • Enum Constant Details

    • DEFAULT

      @Stability(Experimental) public static final Tenancy DEFAULT
      (experimental) Instances will be launched with default tenancy.
    • DEDICATED

      @Stability(Experimental) public static final Tenancy DEDICATED
      (experimental) Instances will be launched with dedicated tenancy.
    • HOST

      @Stability(Experimental) public static final Tenancy HOST
      (experimental) Instances will be launched on a dedicated host.
  • Method Details

    • values

      public static Tenancy[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static Tenancy valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null