All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.awsnative.cloudfront.kotlin.outputs.DistributionConfig.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 1.11.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.awsnative.cloudfront.kotlin.outputs

import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.collections.List

/**
 * A distribution configuration.
 * @property aliases A complex type that contains information about CNAMEs (alternate domain names), if any, for this distribution.
 * @property cacheBehaviors A complex type that contains zero or more ``CacheBehavior`` elements.
 * @property cnames An alias for the CloudFront distribution's domain name.
 * > This property is legacy. We recommend that you use [Aliases](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-distributionconfig.html#cfn-cloudfront-distribution-distributionconfig-aliases) instead.
 * @property comment A comment to describe the distribution. The comment cannot be longer than 128 characters.
 * @property continuousDeploymentPolicyId The identifier of a continuous deployment policy. For more information, see ``CreateContinuousDeploymentPolicy``.
 * @property customErrorResponses A complex type that controls the following:
 *   +  Whether CloudFront replaces HTTP status codes in the 4xx and 5xx range with custom error messages before returning the response to the viewer.
 *   +  How long CloudFront caches HTTP status codes in the 4xx and 5xx range.
 *  For more information about custom error pages, see [Customizing Error Responses](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/custom-error-pages.html) in the *Amazon CloudFront Developer Guide*.
 * @property customOrigin The user-defined HTTP server that serves as the origin for content that CloudFront distributes.
 * > This property is legacy. We recommend that you use [Origin](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-origin.html) instead.
 * @property defaultCacheBehavior A complex type that describes the default cache behavior if you don't specify a ``CacheBehavior`` element or if files don't match any of the values of ``PathPattern`` in ``CacheBehavior`` elements. You must create exactly one default cache behavior.
 * @property defaultRootObject The object that you want CloudFront to request from your origin (for example, ``index.html``) when a viewer requests the root URL for your distribution (``https://www.example.com``) instead of an object in your distribution (``https://www.example.com/product-description.html``). Specifying a default root object avoids exposing the contents of your distribution.
 *  Specify only the object name, for example, ``index.html``. Don't add a ``/`` before the object name.
 *  If you don't want to specify a default root object when you create a distribution, include an empty ``DefaultRootObject`` element.
 *  To delete the default root object from an existing distribution, update the distribution configuration and include an empty ``DefaultRootObject`` element.
 *  To replace the default root object, update the distribution configuration and specify the new object.
 *  For more information about the default root object, see [Creating a Default Root Object](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/DefaultRootObject.html) in the *Amazon CloudFront Developer Guide*.
 * @property enabled From this field, you can enable or disable the selected distribution.
 * @property httpVersion (Optional) Specify the maximum HTTP version(s) that you want viewers to use to communicate with CF. The default value for new distributions is ``http1.1``.
 *  For viewers and CF to use HTTP/2, viewers must support TLSv1.2 or later, and must support Server Name Indication (SNI).
 *  For viewers and CF to use HTTP/3, viewers must support TLSv1.3 and Server Name Indication (SNI). CF supports HTTP/3 connection migration to allow the viewer to switch networks without losing connection. For more information about connection migration, see [Connection Migration](https://docs.aws.amazon.com/https://www.rfc-editor.org/rfc/rfc9000.html#name-connection-migration) at RFC 9000. For more information about supported TLSv1.3 ciphers, see [Supported protocols and ciphers between viewers and CloudFront](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/secure-connections-supported-viewer-protocols-ciphers.html).
 * @property ipv6Enabled If you want CloudFront to respond to IPv6 DNS requests with an IPv6 address for your distribution, specify ``true``. If you specify ``false``, CloudFront responds to IPv6 DNS requests with the DNS response code ``NOERROR`` and with no IP addresses. This allows viewers to submit a second request, for an IPv4 address for your distribution.
 *  In general, you should enable IPv6 if you have users on IPv6 networks who want to access your content. However, if you're using signed URLs or signed cookies to restrict access to your content, and if you're using a custom policy that includes the ``IpAddress`` parameter to restrict the IP addresses that can access your content, don't enable IPv6. If you want to restrict access to some content by IP address and not restrict access to other content (or restrict access but not by IP address), you can create two distributions. For more information, see [Creating a Signed URL Using a Custom Policy](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-creating-signed-url-custom-policy.html) in the *Amazon CloudFront Developer Guide*.
 *  If you're using an R53AWSIntlong alias resource record set to route traffic to your CloudFront distribution, you need to create a second alias resource record set when both of the following are true:
 *   +  You enable IPv6 for the distribution
 *   +  You're using alternate domain names in the URLs for your objects
 *  For more information, see [Routing Traffic to an Amazon CloudFront Web Distribution by Using Your Domain Name](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-to-cloudfront-distribution.html) in the *Developer Guide*.
 *  If you created a CNAME resource record set, either with R53AWSIntlong or with another DNS service, you don't need to make any changes. A CNAME record will route traffic to your distribution regardless of the IP address format of the viewer request.
 * @property logging A complex type that controls whether access logs are written for the distribution.
 *  For more information about logging, see [Access Logs](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/AccessLogs.html) in the *Amazon CloudFront Developer Guide*.
 * @property originGroups A complex type that contains information about origin groups for this distribution.
 * @property origins A complex type that contains information about origins for this distribution.
 * @property priceClass The price class that corresponds with the maximum price that you want to pay for CloudFront service. If you specify ``PriceClass_All``, CloudFront responds to requests for your objects from all CloudFront edge locations.
 *  If you specify a price class other than ``PriceClass_All``, CloudFront serves your objects from the CloudFront edge location that has the lowest latency among the edge locations in your price class. Viewers who are in or near regions that are excluded from your specified price class may encounter slower performance.
 *  For more information about price classes, see [Choosing the Price Class for a CloudFront Distribution](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PriceClass.html) in the *Amazon CloudFront Developer Guide*. For information about CloudFront pricing, including how price classes (such as Price Class 100) map to CloudFront regions, see [Amazon CloudFront Pricing](https://docs.aws.amazon.com/cloudfront/pricing/).
 * @property restrictions A complex type that identifies ways in which you want to restrict distribution of your content.
 * @property s3Origin The origin as an Amazon S3 bucket.
 * > This property is legacy. We recommend that you use [Origin](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-origin.html) instead.
 * @property staging A Boolean that indicates whether this is a staging distribution. When this value is ``true``, this is a staging distribution. When this value is ``false``, this is not a staging distribution.
 * @property viewerCertificate A complex type that determines the distribution's SSL/TLS configuration for communicating with viewers.
 * @property webAclId A unique identifier that specifies the WAF web ACL, if any, to associate with this distribution. To specify a web ACL created using the latest version of WAF, use the ACL ARN, for example ``arn:aws:wafv2:us-east-1:123456789012:global/webacl/ExampleWebACL/473e64fd-f30b-4765-81a0-62ad96dd167a``. To specify a web ACL created using WAF Classic, use the ACL ID, for example ``473e64fd-f30b-4765-81a0-62ad96dd167a``.
 *   WAF is a web application firewall that lets you monitor the HTTP and HTTPS requests that are forwarded to CloudFront, and lets you control access to your content. Based on conditions that you specify, such as the IP addresses that requests originate from or the values of query strings, CloudFront responds to requests either with the requested content or with an HTTP 403 status code (Forbidden). You can also configure CloudFront to return a custom error page when a request is blocked. For more information about WAF, see the [Developer Guide](https://docs.aws.amazon.com/waf/latest/developerguide/what-is-aws-waf.html).
 */
public data class DistributionConfig(
    public val aliases: List? = null,
    public val cacheBehaviors: List? = null,
    public val cnames: List? = null,
    public val comment: String? = null,
    public val continuousDeploymentPolicyId: String? = null,
    public val customErrorResponses: List? = null,
    public val customOrigin: DistributionLegacyCustomOrigin? = null,
    public val defaultCacheBehavior: DistributionDefaultCacheBehavior,
    public val defaultRootObject: String? = null,
    public val enabled: Boolean,
    public val httpVersion: String? = null,
    public val ipv6Enabled: Boolean? = null,
    public val logging: DistributionLogging? = null,
    public val originGroups: DistributionOriginGroups? = null,
    public val origins: List? = null,
    public val priceClass: String? = null,
    public val restrictions: DistributionRestrictions? = null,
    public val s3Origin: DistributionLegacyS3Origin? = null,
    public val staging: Boolean? = null,
    public val viewerCertificate: DistributionViewerCertificate? = null,
    public val webAclId: String? = null,
) {
    public companion object {
        public fun toKotlin(javaType: com.pulumi.awsnative.cloudfront.outputs.DistributionConfig): DistributionConfig = DistributionConfig(
            aliases = javaType.aliases().map({ args0 -> args0 }),
            cacheBehaviors = javaType.cacheBehaviors().map({ args0 ->
                args0.let({ args0 ->
                    com.pulumi.awsnative.cloudfront.kotlin.outputs.DistributionCacheBehavior.Companion.toKotlin(args0)
                })
            }),
            cnames = javaType.cnames().map({ args0 -> args0 }),
            comment = javaType.comment().map({ args0 -> args0 }).orElse(null),
            continuousDeploymentPolicyId = javaType.continuousDeploymentPolicyId().map({ args0 ->
                args0
            }).orElse(null),
            customErrorResponses = javaType.customErrorResponses().map({ args0 ->
                args0.let({ args0 ->
                    com.pulumi.awsnative.cloudfront.kotlin.outputs.DistributionCustomErrorResponse.Companion.toKotlin(args0)
                })
            }),
            customOrigin = javaType.customOrigin().map({ args0 ->
                args0.let({ args0 ->
                    com.pulumi.awsnative.cloudfront.kotlin.outputs.DistributionLegacyCustomOrigin.Companion.toKotlin(args0)
                })
            }).orElse(null),
            defaultCacheBehavior = javaType.defaultCacheBehavior().let({ args0 ->
                com.pulumi.awsnative.cloudfront.kotlin.outputs.DistributionDefaultCacheBehavior.Companion.toKotlin(args0)
            }),
            defaultRootObject = javaType.defaultRootObject().map({ args0 -> args0 }).orElse(null),
            enabled = javaType.enabled(),
            httpVersion = javaType.httpVersion().map({ args0 -> args0 }).orElse(null),
            ipv6Enabled = javaType.ipv6Enabled().map({ args0 -> args0 }).orElse(null),
            logging = javaType.logging().map({ args0 ->
                args0.let({ args0 ->
                    com.pulumi.awsnative.cloudfront.kotlin.outputs.DistributionLogging.Companion.toKotlin(args0)
                })
            }).orElse(null),
            originGroups = javaType.originGroups().map({ args0 ->
                args0.let({ args0 ->
                    com.pulumi.awsnative.cloudfront.kotlin.outputs.DistributionOriginGroups.Companion.toKotlin(args0)
                })
            }).orElse(null),
            origins = javaType.origins().map({ args0 ->
                args0.let({ args0 ->
                    com.pulumi.awsnative.cloudfront.kotlin.outputs.DistributionOrigin.Companion.toKotlin(args0)
                })
            }),
            priceClass = javaType.priceClass().map({ args0 -> args0 }).orElse(null),
            restrictions = javaType.restrictions().map({ args0 ->
                args0.let({ args0 ->
                    com.pulumi.awsnative.cloudfront.kotlin.outputs.DistributionRestrictions.Companion.toKotlin(args0)
                })
            }).orElse(null),
            s3Origin = javaType.s3Origin().map({ args0 ->
                args0.let({ args0 ->
                    com.pulumi.awsnative.cloudfront.kotlin.outputs.DistributionLegacyS3Origin.Companion.toKotlin(args0)
                })
            }).orElse(null),
            staging = javaType.staging().map({ args0 -> args0 }).orElse(null),
            viewerCertificate = javaType.viewerCertificate().map({ args0 ->
                args0.let({ args0 ->
                    com.pulumi.awsnative.cloudfront.kotlin.outputs.DistributionViewerCertificate.Companion.toKotlin(args0)
                })
            }).orElse(null),
            webAclId = javaType.webAclId().map({ args0 -> args0 }).orElse(null),
        )
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy