Class CfnConnectionGroup

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
IInspectable, ITaggableV2, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.112.0 (build de1bc80)", date="2025-07-16T11:43:10.962Z") @Stability(Stable) public class CfnConnectionGroup extends CfnResource implements IInspectable, ITaggableV2
The connection group for your distribution tenants.

When you first create a distribution tenant and you don't specify a connection group, CloudFront will automatically create a default connection group for you. When you create a new distribution tenant and don't specify a connection group, the default one will be associated with your distribution tenant.

Example:

 import software.amazon.awscdk.services.route53.*;
 // Create the simple Origin
 Bucket myBucket = new Bucket(this, "myBucket");
 IOrigin s3Origin = S3BucketOrigin.withOriginAccessControl(myBucket, S3BucketOriginWithOACProps.builder()
         .originAccessLevels(List.of(AccessLevel.READ, AccessLevel.LIST))
         .build());
 // Create the Distribution construct
 Distribution myMultiTenantDistribution = Distribution.Builder.create(this, "cf-hosted-distribution")
         .defaultBehavior(BehaviorOptions.builder()
                 .origin(s3Origin)
                 .build())
         .defaultRootObject("index.html")
         .build();
 // Access the underlying L1 CfnDistribution to configure SaaS Manager properties which are not yet available in the L2 Distribution construct
 CfnDistribution cfnDistribution = (CfnDistribution)myMultiTenantDistribution.getNode().getDefaultChild();
 DefaultCacheBehaviorProperty defaultCacheBehavior = DefaultCacheBehaviorProperty.builder()
         .targetOriginId(myBucket.getBucketArn())
         .viewerProtocolPolicy("allow-all")
         .compress(false)
         .allowedMethods(List.of("GET", "HEAD"))
         .cachePolicyId(CachePolicy.CACHING_OPTIMIZED.getCachePolicyId())
         .build();
 // Create the updated distributionConfig
 DistributionConfigProperty distributionConfig = DistributionConfigProperty.builder()
         .defaultCacheBehavior(defaultCacheBehavior)
         .enabled(true)
         // the properties below are optional
         .connectionMode("tenant-only")
         .origins(List.of(OriginProperty.builder()
                 .id(myBucket.getBucketArn())
                 .domainName(myBucket.getBucketDomainName())
                 .s3OriginConfig(S3OriginConfigProperty.builder().build())
                 .originPath("/{{tenantName}}")
                 .build()))
         .tenantConfig(TenantConfigProperty.builder()
                 .parameterDefinitions(List.of(ParameterDefinitionProperty.builder()
                         .definition(DefinitionProperty.builder()
                                 .stringSchema(StringSchemaProperty.builder()
                                         .required(false)
                                         // the properties below are optional
                                         .comment("tenantName")
                                         .defaultValue("root")
                                         .build())
                                 .build())
                         .name("tenantName")
                         .build()))
                 .build())
         .build();
 // Override the distribution configuration to enable multi-tenancy.
 cfnDistribution.getDistributionConfig() = distributionConfig;
 // Create a connection group and a cname record in an existing hosted zone to validate domain ownership
 CfnConnectionGroup connectionGroup = CfnConnectionGroup.Builder.create(this, "cf-hosted-connection-group")
         .enabled(true)
         .ipv6Enabled(true)
         .name("my-connection-group")
         .build();
 // Import the existing hosted zone info, replacing with your hostedZoneId and zoneName
 String hostedZoneId = "YOUR_HOSTED_ZONE_ID";
 String zoneName = "my.domain.com";
 IHostedZone hostedZone = HostedZone.fromHostedZoneAttributes(this, "hosted-zone", HostedZoneAttributes.builder()
         .hostedZoneId(hostedZoneId)
         .zoneName(zoneName)
         .build());
 CnameRecord record = CnameRecord.Builder.create(this, "cname-record")
         .domainName(connectionGroup.getAttrRoutingEndpoint())
         .zone(hostedZone)
         .recordName("cf-hosted-tenant.my.domain.com")
         .build();
 // Create the cloudfront-hosted tenant, passing in the previously created connection group
 CfnDistributionTenant cloudfrontHostedTenant = CfnDistributionTenant.Builder.create(this, "cf-hosted-tenant")
         .distributionId(myMultiTenantDistribution.getDistributionId())
         .name("cf-hosted-tenant")
         .domains(List.of("cf-hosted-tenant.my.domain.com"))
         .connectionGroupId(connectionGroup.getAttrId())
         .enabled(true)
         .managedCertificateRequest(ManagedCertificateRequestProperty.builder()
                 .validationTokenHost("cloudfront")
                 .build())
         .build();
 

See Also:
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
  • Constructor Details

    • CfnConnectionGroup

      protected CfnConnectionGroup(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnConnectionGroup

      protected CfnConnectionGroup(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnConnectionGroup

      @Stability(Stable) public CfnConnectionGroup(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnConnectionGroupProps props)
      Parameters:
      scope - Scope in which this resource is defined. This parameter is required.
      id - Construct identifier for this resource (unique in its scope). This parameter is required.
      props - Resource properties. This parameter is required.
  • Method Details

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      Parameters:
      inspector - tree inspector to collect and process attributes. This parameter is required.
    • renderProperties

      @Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
      Overrides:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrArn

      @Stability(Stable) @NotNull public String getAttrArn()
      The Amazon Resource Name (ARN) of the connection group.
    • getAttrCreatedTime

      @Stability(Stable) @NotNull public String getAttrCreatedTime()
      The date and time when the connection group was created.
    • getAttrETag

      @Stability(Stable) @NotNull public String getAttrETag()
      The current version of the connection group.
    • getAttrId

      @Stability(Stable) @NotNull public String getAttrId()
      The ID of the connection group.
    • getAttrIsDefault

      @Stability(Stable) @NotNull public IResolvable getAttrIsDefault()
      Whether the connection group is the default connection group for the distribution tenants.
    • getAttrLastModifiedTime

      @Stability(Stable) @NotNull public String getAttrLastModifiedTime()
      The date and time when the connection group was updated.
    • getAttrRoutingEndpoint

      @Stability(Stable) @NotNull public String getAttrRoutingEndpoint()
      The routing endpoint (also known as the DNS name) that is assigned to the connection group, such as d111111abcdef8.cloudfront.net.
    • getAttrStatus

      @Stability(Stable) @NotNull public String getAttrStatus()
      The status of the connection group.
    • getCdkTagManager

      @Stability(Stable) @NotNull public TagManager getCdkTagManager()
      Tag Manager which manages the tags for this resource.
      Specified by:
      getCdkTagManager in interface ITaggableV2
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getName

      @Stability(Stable) @NotNull public String getName()
      The name of the connection group.
    • setName

      @Stability(Stable) public void setName(@NotNull String value)
      The name of the connection group.
    • getAnycastIpListId

      @Stability(Stable) @Nullable public String getAnycastIpListId()
      The ID of the Anycast static IP list.
    • setAnycastIpListId

      @Stability(Stable) public void setAnycastIpListId(@Nullable String value)
      The ID of the Anycast static IP list.
    • getEnabled

      @Stability(Stable) @Nullable public Object getEnabled()
      Whether the connection group is enabled.
    • setEnabled

      @Stability(Stable) public void setEnabled(@Nullable Boolean value)
      Whether the connection group is enabled.
    • setEnabled

      @Stability(Stable) public void setEnabled(@Nullable IResolvable value)
      Whether the connection group is enabled.
    • getIpv6Enabled

      @Stability(Stable) @Nullable public Object getIpv6Enabled()
      IPv6 is enabled for the connection group.
    • setIpv6Enabled

      @Stability(Stable) public void setIpv6Enabled(@Nullable Boolean value)
      IPv6 is enabled for the connection group.
    • setIpv6Enabled

      @Stability(Stable) public void setIpv6Enabled(@Nullable IResolvable value)
      IPv6 is enabled for the connection group.
    • getTags

      @Stability(Stable) @Nullable public List<CfnTag> getTags()
      A complex type that contains zero or more Tag elements.
    • setTags

      @Stability(Stable) public void setTags(@Nullable List<CfnTag> value)
      A complex type that contains zero or more Tag elements.