github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/cloudfront/distribution.go (about)

     1  // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
     2  // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
     3  
     4  package cloudfront
     5  
     6  import (
     7  	"context"
     8  	"reflect"
     9  
    10  	"errors"
    11  	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
    12  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    13  )
    14  
    15  // Creates an Amazon CloudFront web distribution.
    16  //
    17  // For information about CloudFront distributions, see the [Amazon CloudFront Developer Guide](http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Introduction.html). For specific information about creating CloudFront web distributions, see the [POST Distribution](https://docs.aws.amazon.com/cloudfront/latest/APIReference/API_CreateDistribution.html) page in the Amazon CloudFront API Reference.
    18  //
    19  // > **NOTE:** CloudFront distributions take about 15 minutes to reach a deployed state after creation or modification. During this time, deletes to resources will be blocked. If you need to delete a distribution that is enabled and you do not want to wait, you need to use the `retainOnDelete` flag.
    20  //
    21  // ## Example Usage
    22  //
    23  // ### S3 Origin
    24  //
    25  // The example below creates a CloudFront distribution with an S3 origin.
    26  //
    27  // <!--Start PulumiCodeChooser -->
    28  // ```go
    29  // package main
    30  //
    31  // import (
    32  //
    33  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/cloudfront"
    34  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/s3"
    35  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    36  //
    37  // )
    38  //
    39  //	func main() {
    40  //		pulumi.Run(func(ctx *pulumi.Context) error {
    41  //			b, err := s3.NewBucketV2(ctx, "b", &s3.BucketV2Args{
    42  //				Bucket: pulumi.String("mybucket"),
    43  //				Tags: pulumi.StringMap{
    44  //					"Name": pulumi.String("My bucket"),
    45  //				},
    46  //			})
    47  //			if err != nil {
    48  //				return err
    49  //			}
    50  //			_, err = s3.NewBucketAclV2(ctx, "b_acl", &s3.BucketAclV2Args{
    51  //				Bucket: b.ID(),
    52  //				Acl:    pulumi.String("private"),
    53  //			})
    54  //			if err != nil {
    55  //				return err
    56  //			}
    57  //			s3OriginId := "myS3Origin"
    58  //			_, err = cloudfront.NewDistribution(ctx, "s3_distribution", &cloudfront.DistributionArgs{
    59  //				Origins: cloudfront.DistributionOriginArray{
    60  //					&cloudfront.DistributionOriginArgs{
    61  //						DomainName:            b.BucketRegionalDomainName,
    62  //						OriginAccessControlId: pulumi.Any(_default.Id),
    63  //						OriginId:              pulumi.String(s3OriginId),
    64  //					},
    65  //				},
    66  //				Enabled:           pulumi.Bool(true),
    67  //				IsIpv6Enabled:     pulumi.Bool(true),
    68  //				Comment:           pulumi.String("Some comment"),
    69  //				DefaultRootObject: pulumi.String("index.html"),
    70  //				LoggingConfig: &cloudfront.DistributionLoggingConfigArgs{
    71  //					IncludeCookies: pulumi.Bool(false),
    72  //					Bucket:         pulumi.String("mylogs.s3.amazonaws.com"),
    73  //					Prefix:         pulumi.String("myprefix"),
    74  //				},
    75  //				Aliases: pulumi.StringArray{
    76  //					pulumi.String("mysite.example.com"),
    77  //					pulumi.String("yoursite.example.com"),
    78  //				},
    79  //				DefaultCacheBehavior: &cloudfront.DistributionDefaultCacheBehaviorArgs{
    80  //					AllowedMethods: pulumi.StringArray{
    81  //						pulumi.String("DELETE"),
    82  //						pulumi.String("GET"),
    83  //						pulumi.String("HEAD"),
    84  //						pulumi.String("OPTIONS"),
    85  //						pulumi.String("PATCH"),
    86  //						pulumi.String("POST"),
    87  //						pulumi.String("PUT"),
    88  //					},
    89  //					CachedMethods: pulumi.StringArray{
    90  //						pulumi.String("GET"),
    91  //						pulumi.String("HEAD"),
    92  //					},
    93  //					TargetOriginId: pulumi.String(s3OriginId),
    94  //					ForwardedValues: &cloudfront.DistributionDefaultCacheBehaviorForwardedValuesArgs{
    95  //						QueryString: pulumi.Bool(false),
    96  //						Cookies: &cloudfront.DistributionDefaultCacheBehaviorForwardedValuesCookiesArgs{
    97  //							Forward: pulumi.String("none"),
    98  //						},
    99  //					},
   100  //					ViewerProtocolPolicy: pulumi.String("allow-all"),
   101  //					MinTtl:               pulumi.Int(0),
   102  //					DefaultTtl:           pulumi.Int(3600),
   103  //					MaxTtl:               pulumi.Int(86400),
   104  //				},
   105  //				OrderedCacheBehaviors: cloudfront.DistributionOrderedCacheBehaviorArray{
   106  //					&cloudfront.DistributionOrderedCacheBehaviorArgs{
   107  //						PathPattern: pulumi.String("/content/immutable/*"),
   108  //						AllowedMethods: pulumi.StringArray{
   109  //							pulumi.String("GET"),
   110  //							pulumi.String("HEAD"),
   111  //							pulumi.String("OPTIONS"),
   112  //						},
   113  //						CachedMethods: pulumi.StringArray{
   114  //							pulumi.String("GET"),
   115  //							pulumi.String("HEAD"),
   116  //							pulumi.String("OPTIONS"),
   117  //						},
   118  //						TargetOriginId: pulumi.String(s3OriginId),
   119  //						ForwardedValues: &cloudfront.DistributionOrderedCacheBehaviorForwardedValuesArgs{
   120  //							QueryString: pulumi.Bool(false),
   121  //							Headers: pulumi.StringArray{
   122  //								pulumi.String("Origin"),
   123  //							},
   124  //							Cookies: &cloudfront.DistributionOrderedCacheBehaviorForwardedValuesCookiesArgs{
   125  //								Forward: pulumi.String("none"),
   126  //							},
   127  //						},
   128  //						MinTtl:               pulumi.Int(0),
   129  //						DefaultTtl:           pulumi.Int(86400),
   130  //						MaxTtl:               pulumi.Int(31536000),
   131  //						Compress:             pulumi.Bool(true),
   132  //						ViewerProtocolPolicy: pulumi.String("redirect-to-https"),
   133  //					},
   134  //					&cloudfront.DistributionOrderedCacheBehaviorArgs{
   135  //						PathPattern: pulumi.String("/content/*"),
   136  //						AllowedMethods: pulumi.StringArray{
   137  //							pulumi.String("GET"),
   138  //							pulumi.String("HEAD"),
   139  //							pulumi.String("OPTIONS"),
   140  //						},
   141  //						CachedMethods: pulumi.StringArray{
   142  //							pulumi.String("GET"),
   143  //							pulumi.String("HEAD"),
   144  //						},
   145  //						TargetOriginId: pulumi.String(s3OriginId),
   146  //						ForwardedValues: &cloudfront.DistributionOrderedCacheBehaviorForwardedValuesArgs{
   147  //							QueryString: pulumi.Bool(false),
   148  //							Cookies: &cloudfront.DistributionOrderedCacheBehaviorForwardedValuesCookiesArgs{
   149  //								Forward: pulumi.String("none"),
   150  //							},
   151  //						},
   152  //						MinTtl:               pulumi.Int(0),
   153  //						DefaultTtl:           pulumi.Int(3600),
   154  //						MaxTtl:               pulumi.Int(86400),
   155  //						Compress:             pulumi.Bool(true),
   156  //						ViewerProtocolPolicy: pulumi.String("redirect-to-https"),
   157  //					},
   158  //				},
   159  //				PriceClass: pulumi.String("PriceClass_200"),
   160  //				Restrictions: &cloudfront.DistributionRestrictionsArgs{
   161  //					GeoRestriction: &cloudfront.DistributionRestrictionsGeoRestrictionArgs{
   162  //						RestrictionType: pulumi.String("whitelist"),
   163  //						Locations: pulumi.StringArray{
   164  //							pulumi.String("US"),
   165  //							pulumi.String("CA"),
   166  //							pulumi.String("GB"),
   167  //							pulumi.String("DE"),
   168  //						},
   169  //					},
   170  //				},
   171  //				Tags: pulumi.StringMap{
   172  //					"Environment": pulumi.String("production"),
   173  //				},
   174  //				ViewerCertificate: &cloudfront.DistributionViewerCertificateArgs{
   175  //					CloudfrontDefaultCertificate: pulumi.Bool(true),
   176  //				},
   177  //			})
   178  //			if err != nil {
   179  //				return err
   180  //			}
   181  //			return nil
   182  //		})
   183  //	}
   184  //
   185  // ```
   186  // <!--End PulumiCodeChooser -->
   187  //
   188  // ### With Failover Routing
   189  //
   190  // The example below creates a CloudFront distribution with an origin group for failover routing.
   191  //
   192  // <!--Start PulumiCodeChooser -->
   193  // ```go
   194  // package main
   195  //
   196  // import (
   197  //
   198  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/cloudfront"
   199  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
   200  //
   201  // )
   202  //
   203  //	func main() {
   204  //		pulumi.Run(func(ctx *pulumi.Context) error {
   205  //			_, err := cloudfront.NewDistribution(ctx, "s3_distribution", &cloudfront.DistributionArgs{
   206  //				OriginGroups: cloudfront.DistributionOriginGroupArray{
   207  //					&cloudfront.DistributionOriginGroupArgs{
   208  //						OriginId: pulumi.String("groupS3"),
   209  //						FailoverCriteria: &cloudfront.DistributionOriginGroupFailoverCriteriaArgs{
   210  //							StatusCodes: pulumi.IntArray{
   211  //								pulumi.Int(403),
   212  //								pulumi.Int(404),
   213  //								pulumi.Int(500),
   214  //								pulumi.Int(502),
   215  //							},
   216  //						},
   217  //						Members: cloudfront.DistributionOriginGroupMemberArray{
   218  //							&cloudfront.DistributionOriginGroupMemberArgs{
   219  //								OriginId: pulumi.String("primaryS3"),
   220  //							},
   221  //							&cloudfront.DistributionOriginGroupMemberArgs{
   222  //								OriginId: pulumi.String("failoverS3"),
   223  //							},
   224  //						},
   225  //					},
   226  //				},
   227  //				Origins: cloudfront.DistributionOriginArray{
   228  //					&cloudfront.DistributionOriginArgs{
   229  //						DomainName: pulumi.Any(primary.BucketRegionalDomainName),
   230  //						OriginId:   pulumi.String("primaryS3"),
   231  //						S3OriginConfig: &cloudfront.DistributionOriginS3OriginConfigArgs{
   232  //							OriginAccessIdentity: pulumi.Any(_default.CloudfrontAccessIdentityPath),
   233  //						},
   234  //					},
   235  //					&cloudfront.DistributionOriginArgs{
   236  //						DomainName: pulumi.Any(failover.BucketRegionalDomainName),
   237  //						OriginId:   pulumi.String("failoverS3"),
   238  //						S3OriginConfig: &cloudfront.DistributionOriginS3OriginConfigArgs{
   239  //							OriginAccessIdentity: pulumi.Any(_default.CloudfrontAccessIdentityPath),
   240  //						},
   241  //					},
   242  //				},
   243  //				DefaultCacheBehavior: &cloudfront.DistributionDefaultCacheBehaviorArgs{
   244  //					TargetOriginId: pulumi.String("groupS3"),
   245  //				},
   246  //			})
   247  //			if err != nil {
   248  //				return err
   249  //			}
   250  //			return nil
   251  //		})
   252  //	}
   253  //
   254  // ```
   255  // <!--End PulumiCodeChooser -->
   256  //
   257  // ### With Managed Caching Policy
   258  //
   259  // The example below creates a CloudFront distribution with an [AWS managed caching policy](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-cache-policies.html).
   260  //
   261  // <!--Start PulumiCodeChooser -->
   262  // ```go
   263  // package main
   264  //
   265  // import (
   266  //
   267  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/cloudfront"
   268  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
   269  //
   270  // )
   271  //
   272  //	func main() {
   273  //		pulumi.Run(func(ctx *pulumi.Context) error {
   274  //			s3OriginId := "myS3Origin"
   275  //			_, err := cloudfront.NewDistribution(ctx, "s3_distribution", &cloudfront.DistributionArgs{
   276  //				Origins: cloudfront.DistributionOriginArray{
   277  //					&cloudfront.DistributionOriginArgs{
   278  //						DomainName: pulumi.Any(primary.BucketRegionalDomainName),
   279  //						OriginId:   pulumi.String("myS3Origin"),
   280  //						S3OriginConfig: &cloudfront.DistributionOriginS3OriginConfigArgs{
   281  //							OriginAccessIdentity: pulumi.Any(_default.CloudfrontAccessIdentityPath),
   282  //						},
   283  //					},
   284  //				},
   285  //				Enabled:           pulumi.Bool(true),
   286  //				IsIpv6Enabled:     pulumi.Bool(true),
   287  //				Comment:           pulumi.String("Some comment"),
   288  //				DefaultRootObject: pulumi.String("index.html"),
   289  //				DefaultCacheBehavior: &cloudfront.DistributionDefaultCacheBehaviorArgs{
   290  //					CachePolicyId: pulumi.String("4135ea2d-6df8-44a3-9df3-4b5a84be39ad"),
   291  //					AllowedMethods: pulumi.StringArray{
   292  //						pulumi.String("GET"),
   293  //						pulumi.String("HEAD"),
   294  //						pulumi.String("OPTIONS"),
   295  //					},
   296  //					TargetOriginId: pulumi.String(s3OriginId),
   297  //				},
   298  //				Restrictions: &cloudfront.DistributionRestrictionsArgs{
   299  //					GeoRestriction: &cloudfront.DistributionRestrictionsGeoRestrictionArgs{
   300  //						RestrictionType: pulumi.String("whitelist"),
   301  //						Locations: pulumi.StringArray{
   302  //							pulumi.String("US"),
   303  //							pulumi.String("CA"),
   304  //							pulumi.String("GB"),
   305  //							pulumi.String("DE"),
   306  //						},
   307  //					},
   308  //				},
   309  //				ViewerCertificate: &cloudfront.DistributionViewerCertificateArgs{
   310  //					CloudfrontDefaultCertificate: pulumi.Bool(true),
   311  //				},
   312  //			})
   313  //			if err != nil {
   314  //				return err
   315  //			}
   316  //			return nil
   317  //		})
   318  //	}
   319  //
   320  // ```
   321  // <!--End PulumiCodeChooser -->
   322  //
   323  // ## Import
   324  //
   325  // Using `pulumi import`, import CloudFront Distributions using the `id`. For example:
   326  //
   327  // ```sh
   328  // $ pulumi import aws:cloudfront/distribution:Distribution distribution E74FTE3EXAMPLE
   329  // ```
   330  type Distribution struct {
   331  	pulumi.CustomResourceState
   332  
   333  	// Extra CNAMEs (alternate domain names), if any, for this distribution.
   334  	Aliases pulumi.StringArrayOutput `pulumi:"aliases"`
   335  	// ARN for the distribution. For example: `arn:aws:cloudfront::123456789012:distribution/EDFDVBD632BHDS5`, where `123456789012` is your AWS account ID.
   336  	Arn pulumi.StringOutput `pulumi:"arn"`
   337  	// Internal value used by CloudFront to allow future updates to the distribution configuration.
   338  	CallerReference pulumi.StringOutput `pulumi:"callerReference"`
   339  	// Any comments you want to include about the distribution.
   340  	Comment pulumi.StringPtrOutput `pulumi:"comment"`
   341  	// Identifier of a continuous deployment policy. This argument should only be set on a production distribution. See the `cloudfront.ContinuousDeploymentPolicy` resource for additional details.
   342  	ContinuousDeploymentPolicyId pulumi.StringOutput `pulumi:"continuousDeploymentPolicyId"`
   343  	// One or more custom error response elements (multiples allowed).
   344  	CustomErrorResponses DistributionCustomErrorResponseArrayOutput `pulumi:"customErrorResponses"`
   345  	// Default cache behavior for this distribution (maximum one). Requires either `cachePolicyId` (preferred) or `forwardedValues` (deprecated) be set.
   346  	DefaultCacheBehavior DistributionDefaultCacheBehaviorOutput `pulumi:"defaultCacheBehavior"`
   347  	// Object that you want CloudFront to return (for example, index.html) when an end user requests the root URL.
   348  	DefaultRootObject pulumi.StringPtrOutput `pulumi:"defaultRootObject"`
   349  	// DNS domain name of either the S3 bucket, or web site of your custom origin.
   350  	DomainName pulumi.StringOutput `pulumi:"domainName"`
   351  	// Whether Origin Shield is enabled.
   352  	Enabled pulumi.BoolOutput `pulumi:"enabled"`
   353  	// Current version of the distribution's information. For example: `E2QWRUHAPOMQZL`.
   354  	Etag pulumi.StringOutput `pulumi:"etag"`
   355  	// CloudFront Route 53 zone ID that can be used to route an [Alias Resource Record Set](http://docs.aws.amazon.com/Route53/latest/APIReference/CreateAliasRRSAPI.html) to. This attribute is simply an alias for the zone ID `Z2FDTNDATAQYW2`.
   356  	HostedZoneId pulumi.StringOutput `pulumi:"hostedZoneId"`
   357  	// Maximum HTTP version to support on the distribution. Allowed values are `http1.1`, `http2`, `http2and3` and `http3`. The default is `http2`.
   358  	HttpVersion pulumi.StringPtrOutput `pulumi:"httpVersion"`
   359  	// Number of invalidation batches currently in progress.
   360  	InProgressValidationBatches pulumi.IntOutput `pulumi:"inProgressValidationBatches"`
   361  	// Whether the IPv6 is enabled for the distribution.
   362  	IsIpv6Enabled pulumi.BoolPtrOutput `pulumi:"isIpv6Enabled"`
   363  	// Date and time the distribution was last modified.
   364  	LastModifiedTime pulumi.StringOutput `pulumi:"lastModifiedTime"`
   365  	// The logging configuration that controls how logs are written to your distribution (maximum one).
   366  	LoggingConfig DistributionLoggingConfigPtrOutput `pulumi:"loggingConfig"`
   367  	// Ordered list of cache behaviors resource for this distribution. List from top to bottom in order of precedence. The topmost cache behavior will have precedence 0.
   368  	OrderedCacheBehaviors DistributionOrderedCacheBehaviorArrayOutput `pulumi:"orderedCacheBehaviors"`
   369  	// One or more originGroup for this distribution (multiples allowed).
   370  	OriginGroups DistributionOriginGroupArrayOutput `pulumi:"originGroups"`
   371  	// One or more origins for this distribution (multiples allowed).
   372  	Origins DistributionOriginArrayOutput `pulumi:"origins"`
   373  	// Price class for this distribution. One of `PriceClass_All`, `PriceClass_200`, `PriceClass_100`.
   374  	PriceClass pulumi.StringPtrOutput `pulumi:"priceClass"`
   375  	// The restriction configuration for this distribution (maximum one).
   376  	Restrictions DistributionRestrictionsOutput `pulumi:"restrictions"`
   377  	// Disables the distribution instead of deleting it when destroying the resource through the provider. If this is set, the distribution needs to be deleted manually afterwards. Default: `false`.
   378  	RetainOnDelete pulumi.BoolPtrOutput `pulumi:"retainOnDelete"`
   379  	// A Boolean that indicates whether this is a staging distribution. Defaults to `false`.
   380  	Staging pulumi.BoolPtrOutput `pulumi:"staging"`
   381  	// Current status of the distribution. `Deployed` if the distribution's information is fully propagated throughout the Amazon CloudFront system.
   382  	Status pulumi.StringOutput `pulumi:"status"`
   383  	// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   384  	Tags pulumi.StringMapOutput `pulumi:"tags"`
   385  	// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   386  	//
   387  	// Deprecated: Please use `tags` instead.
   388  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
   389  	// List of key group IDs that CloudFront can use to validate signed URLs or signed cookies. See the [CloudFront User Guide](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-trusted-signers.html) for more information about this feature.
   390  	TrustedKeyGroups DistributionTrustedKeyGroupArrayOutput `pulumi:"trustedKeyGroups"`
   391  	// List of AWS account IDs (or `self`) that you want to allow to create signed URLs for private content. See the [CloudFront User Guide](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-trusted-signers.html) for more information about this feature.
   392  	TrustedSigners DistributionTrustedSignerArrayOutput `pulumi:"trustedSigners"`
   393  	// The SSL configuration for this distribution (maximum one).
   394  	ViewerCertificate DistributionViewerCertificateOutput `pulumi:"viewerCertificate"`
   395  	// If enabled, the resource will wait for the distribution status to change from `InProgress` to `Deployed`. Setting this to`false` will skip the process. Default: `true`.
   396  	WaitForDeployment pulumi.BoolPtrOutput `pulumi:"waitForDeployment"`
   397  	// Unique identifier that specifies the AWS WAF web ACL, if any, to associate with this distribution. To specify a web ACL created using the latest version of AWS WAF (WAFv2), use the ACL ARN, for example `aws_wafv2_web_acl.example.arn`. To specify a web ACL created using AWS WAF Classic, use the ACL ID, for example `aws_waf_web_acl.example.id`. The WAF Web ACL must exist in the WAF Global (CloudFront) region and the credentials configuring this argument must have `waf:GetWebACL` permissions assigned.
   398  	WebAclId pulumi.StringPtrOutput `pulumi:"webAclId"`
   399  }
   400  
   401  // NewDistribution registers a new resource with the given unique name, arguments, and options.
   402  func NewDistribution(ctx *pulumi.Context,
   403  	name string, args *DistributionArgs, opts ...pulumi.ResourceOption) (*Distribution, error) {
   404  	if args == nil {
   405  		return nil, errors.New("missing one or more required arguments")
   406  	}
   407  
   408  	if args.DefaultCacheBehavior == nil {
   409  		return nil, errors.New("invalid value for required argument 'DefaultCacheBehavior'")
   410  	}
   411  	if args.Enabled == nil {
   412  		return nil, errors.New("invalid value for required argument 'Enabled'")
   413  	}
   414  	if args.Origins == nil {
   415  		return nil, errors.New("invalid value for required argument 'Origins'")
   416  	}
   417  	if args.Restrictions == nil {
   418  		return nil, errors.New("invalid value for required argument 'Restrictions'")
   419  	}
   420  	if args.ViewerCertificate == nil {
   421  		return nil, errors.New("invalid value for required argument 'ViewerCertificate'")
   422  	}
   423  	opts = internal.PkgResourceDefaultOpts(opts)
   424  	var resource Distribution
   425  	err := ctx.RegisterResource("aws:cloudfront/distribution:Distribution", name, args, &resource, opts...)
   426  	if err != nil {
   427  		return nil, err
   428  	}
   429  	return &resource, nil
   430  }
   431  
   432  // GetDistribution gets an existing Distribution resource's state with the given name, ID, and optional
   433  // state properties that are used to uniquely qualify the lookup (nil if not required).
   434  func GetDistribution(ctx *pulumi.Context,
   435  	name string, id pulumi.IDInput, state *DistributionState, opts ...pulumi.ResourceOption) (*Distribution, error) {
   436  	var resource Distribution
   437  	err := ctx.ReadResource("aws:cloudfront/distribution:Distribution", name, id, state, &resource, opts...)
   438  	if err != nil {
   439  		return nil, err
   440  	}
   441  	return &resource, nil
   442  }
   443  
   444  // Input properties used for looking up and filtering Distribution resources.
   445  type distributionState struct {
   446  	// Extra CNAMEs (alternate domain names), if any, for this distribution.
   447  	Aliases []string `pulumi:"aliases"`
   448  	// ARN for the distribution. For example: `arn:aws:cloudfront::123456789012:distribution/EDFDVBD632BHDS5`, where `123456789012` is your AWS account ID.
   449  	Arn *string `pulumi:"arn"`
   450  	// Internal value used by CloudFront to allow future updates to the distribution configuration.
   451  	CallerReference *string `pulumi:"callerReference"`
   452  	// Any comments you want to include about the distribution.
   453  	Comment *string `pulumi:"comment"`
   454  	// Identifier of a continuous deployment policy. This argument should only be set on a production distribution. See the `cloudfront.ContinuousDeploymentPolicy` resource for additional details.
   455  	ContinuousDeploymentPolicyId *string `pulumi:"continuousDeploymentPolicyId"`
   456  	// One or more custom error response elements (multiples allowed).
   457  	CustomErrorResponses []DistributionCustomErrorResponse `pulumi:"customErrorResponses"`
   458  	// Default cache behavior for this distribution (maximum one). Requires either `cachePolicyId` (preferred) or `forwardedValues` (deprecated) be set.
   459  	DefaultCacheBehavior *DistributionDefaultCacheBehavior `pulumi:"defaultCacheBehavior"`
   460  	// Object that you want CloudFront to return (for example, index.html) when an end user requests the root URL.
   461  	DefaultRootObject *string `pulumi:"defaultRootObject"`
   462  	// DNS domain name of either the S3 bucket, or web site of your custom origin.
   463  	DomainName *string `pulumi:"domainName"`
   464  	// Whether Origin Shield is enabled.
   465  	Enabled *bool `pulumi:"enabled"`
   466  	// Current version of the distribution's information. For example: `E2QWRUHAPOMQZL`.
   467  	Etag *string `pulumi:"etag"`
   468  	// CloudFront Route 53 zone ID that can be used to route an [Alias Resource Record Set](http://docs.aws.amazon.com/Route53/latest/APIReference/CreateAliasRRSAPI.html) to. This attribute is simply an alias for the zone ID `Z2FDTNDATAQYW2`.
   469  	HostedZoneId *string `pulumi:"hostedZoneId"`
   470  	// Maximum HTTP version to support on the distribution. Allowed values are `http1.1`, `http2`, `http2and3` and `http3`. The default is `http2`.
   471  	HttpVersion *string `pulumi:"httpVersion"`
   472  	// Number of invalidation batches currently in progress.
   473  	InProgressValidationBatches *int `pulumi:"inProgressValidationBatches"`
   474  	// Whether the IPv6 is enabled for the distribution.
   475  	IsIpv6Enabled *bool `pulumi:"isIpv6Enabled"`
   476  	// Date and time the distribution was last modified.
   477  	LastModifiedTime *string `pulumi:"lastModifiedTime"`
   478  	// The logging configuration that controls how logs are written to your distribution (maximum one).
   479  	LoggingConfig *DistributionLoggingConfig `pulumi:"loggingConfig"`
   480  	// Ordered list of cache behaviors resource for this distribution. List from top to bottom in order of precedence. The topmost cache behavior will have precedence 0.
   481  	OrderedCacheBehaviors []DistributionOrderedCacheBehavior `pulumi:"orderedCacheBehaviors"`
   482  	// One or more originGroup for this distribution (multiples allowed).
   483  	OriginGroups []DistributionOriginGroup `pulumi:"originGroups"`
   484  	// One or more origins for this distribution (multiples allowed).
   485  	Origins []DistributionOrigin `pulumi:"origins"`
   486  	// Price class for this distribution. One of `PriceClass_All`, `PriceClass_200`, `PriceClass_100`.
   487  	PriceClass *string `pulumi:"priceClass"`
   488  	// The restriction configuration for this distribution (maximum one).
   489  	Restrictions *DistributionRestrictions `pulumi:"restrictions"`
   490  	// Disables the distribution instead of deleting it when destroying the resource through the provider. If this is set, the distribution needs to be deleted manually afterwards. Default: `false`.
   491  	RetainOnDelete *bool `pulumi:"retainOnDelete"`
   492  	// A Boolean that indicates whether this is a staging distribution. Defaults to `false`.
   493  	Staging *bool `pulumi:"staging"`
   494  	// Current status of the distribution. `Deployed` if the distribution's information is fully propagated throughout the Amazon CloudFront system.
   495  	Status *string `pulumi:"status"`
   496  	// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   497  	Tags map[string]string `pulumi:"tags"`
   498  	// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   499  	//
   500  	// Deprecated: Please use `tags` instead.
   501  	TagsAll map[string]string `pulumi:"tagsAll"`
   502  	// List of key group IDs that CloudFront can use to validate signed URLs or signed cookies. See the [CloudFront User Guide](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-trusted-signers.html) for more information about this feature.
   503  	TrustedKeyGroups []DistributionTrustedKeyGroup `pulumi:"trustedKeyGroups"`
   504  	// List of AWS account IDs (or `self`) that you want to allow to create signed URLs for private content. See the [CloudFront User Guide](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-trusted-signers.html) for more information about this feature.
   505  	TrustedSigners []DistributionTrustedSigner `pulumi:"trustedSigners"`
   506  	// The SSL configuration for this distribution (maximum one).
   507  	ViewerCertificate *DistributionViewerCertificate `pulumi:"viewerCertificate"`
   508  	// If enabled, the resource will wait for the distribution status to change from `InProgress` to `Deployed`. Setting this to`false` will skip the process. Default: `true`.
   509  	WaitForDeployment *bool `pulumi:"waitForDeployment"`
   510  	// Unique identifier that specifies the AWS WAF web ACL, if any, to associate with this distribution. To specify a web ACL created using the latest version of AWS WAF (WAFv2), use the ACL ARN, for example `aws_wafv2_web_acl.example.arn`. To specify a web ACL created using AWS WAF Classic, use the ACL ID, for example `aws_waf_web_acl.example.id`. The WAF Web ACL must exist in the WAF Global (CloudFront) region and the credentials configuring this argument must have `waf:GetWebACL` permissions assigned.
   511  	WebAclId *string `pulumi:"webAclId"`
   512  }
   513  
   514  type DistributionState struct {
   515  	// Extra CNAMEs (alternate domain names), if any, for this distribution.
   516  	Aliases pulumi.StringArrayInput
   517  	// ARN for the distribution. For example: `arn:aws:cloudfront::123456789012:distribution/EDFDVBD632BHDS5`, where `123456789012` is your AWS account ID.
   518  	Arn pulumi.StringPtrInput
   519  	// Internal value used by CloudFront to allow future updates to the distribution configuration.
   520  	CallerReference pulumi.StringPtrInput
   521  	// Any comments you want to include about the distribution.
   522  	Comment pulumi.StringPtrInput
   523  	// Identifier of a continuous deployment policy. This argument should only be set on a production distribution. See the `cloudfront.ContinuousDeploymentPolicy` resource for additional details.
   524  	ContinuousDeploymentPolicyId pulumi.StringPtrInput
   525  	// One or more custom error response elements (multiples allowed).
   526  	CustomErrorResponses DistributionCustomErrorResponseArrayInput
   527  	// Default cache behavior for this distribution (maximum one). Requires either `cachePolicyId` (preferred) or `forwardedValues` (deprecated) be set.
   528  	DefaultCacheBehavior DistributionDefaultCacheBehaviorPtrInput
   529  	// Object that you want CloudFront to return (for example, index.html) when an end user requests the root URL.
   530  	DefaultRootObject pulumi.StringPtrInput
   531  	// DNS domain name of either the S3 bucket, or web site of your custom origin.
   532  	DomainName pulumi.StringPtrInput
   533  	// Whether Origin Shield is enabled.
   534  	Enabled pulumi.BoolPtrInput
   535  	// Current version of the distribution's information. For example: `E2QWRUHAPOMQZL`.
   536  	Etag pulumi.StringPtrInput
   537  	// CloudFront Route 53 zone ID that can be used to route an [Alias Resource Record Set](http://docs.aws.amazon.com/Route53/latest/APIReference/CreateAliasRRSAPI.html) to. This attribute is simply an alias for the zone ID `Z2FDTNDATAQYW2`.
   538  	HostedZoneId pulumi.StringPtrInput
   539  	// Maximum HTTP version to support on the distribution. Allowed values are `http1.1`, `http2`, `http2and3` and `http3`. The default is `http2`.
   540  	HttpVersion pulumi.StringPtrInput
   541  	// Number of invalidation batches currently in progress.
   542  	InProgressValidationBatches pulumi.IntPtrInput
   543  	// Whether the IPv6 is enabled for the distribution.
   544  	IsIpv6Enabled pulumi.BoolPtrInput
   545  	// Date and time the distribution was last modified.
   546  	LastModifiedTime pulumi.StringPtrInput
   547  	// The logging configuration that controls how logs are written to your distribution (maximum one).
   548  	LoggingConfig DistributionLoggingConfigPtrInput
   549  	// Ordered list of cache behaviors resource for this distribution. List from top to bottom in order of precedence. The topmost cache behavior will have precedence 0.
   550  	OrderedCacheBehaviors DistributionOrderedCacheBehaviorArrayInput
   551  	// One or more originGroup for this distribution (multiples allowed).
   552  	OriginGroups DistributionOriginGroupArrayInput
   553  	// One or more origins for this distribution (multiples allowed).
   554  	Origins DistributionOriginArrayInput
   555  	// Price class for this distribution. One of `PriceClass_All`, `PriceClass_200`, `PriceClass_100`.
   556  	PriceClass pulumi.StringPtrInput
   557  	// The restriction configuration for this distribution (maximum one).
   558  	Restrictions DistributionRestrictionsPtrInput
   559  	// Disables the distribution instead of deleting it when destroying the resource through the provider. If this is set, the distribution needs to be deleted manually afterwards. Default: `false`.
   560  	RetainOnDelete pulumi.BoolPtrInput
   561  	// A Boolean that indicates whether this is a staging distribution. Defaults to `false`.
   562  	Staging pulumi.BoolPtrInput
   563  	// Current status of the distribution. `Deployed` if the distribution's information is fully propagated throughout the Amazon CloudFront system.
   564  	Status pulumi.StringPtrInput
   565  	// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   566  	Tags pulumi.StringMapInput
   567  	// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   568  	//
   569  	// Deprecated: Please use `tags` instead.
   570  	TagsAll pulumi.StringMapInput
   571  	// List of key group IDs that CloudFront can use to validate signed URLs or signed cookies. See the [CloudFront User Guide](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-trusted-signers.html) for more information about this feature.
   572  	TrustedKeyGroups DistributionTrustedKeyGroupArrayInput
   573  	// List of AWS account IDs (or `self`) that you want to allow to create signed URLs for private content. See the [CloudFront User Guide](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-trusted-signers.html) for more information about this feature.
   574  	TrustedSigners DistributionTrustedSignerArrayInput
   575  	// The SSL configuration for this distribution (maximum one).
   576  	ViewerCertificate DistributionViewerCertificatePtrInput
   577  	// If enabled, the resource will wait for the distribution status to change from `InProgress` to `Deployed`. Setting this to`false` will skip the process. Default: `true`.
   578  	WaitForDeployment pulumi.BoolPtrInput
   579  	// Unique identifier that specifies the AWS WAF web ACL, if any, to associate with this distribution. To specify a web ACL created using the latest version of AWS WAF (WAFv2), use the ACL ARN, for example `aws_wafv2_web_acl.example.arn`. To specify a web ACL created using AWS WAF Classic, use the ACL ID, for example `aws_waf_web_acl.example.id`. The WAF Web ACL must exist in the WAF Global (CloudFront) region and the credentials configuring this argument must have `waf:GetWebACL` permissions assigned.
   580  	WebAclId pulumi.StringPtrInput
   581  }
   582  
   583  func (DistributionState) ElementType() reflect.Type {
   584  	return reflect.TypeOf((*distributionState)(nil)).Elem()
   585  }
   586  
   587  type distributionArgs struct {
   588  	// Extra CNAMEs (alternate domain names), if any, for this distribution.
   589  	Aliases []string `pulumi:"aliases"`
   590  	// Any comments you want to include about the distribution.
   591  	Comment *string `pulumi:"comment"`
   592  	// Identifier of a continuous deployment policy. This argument should only be set on a production distribution. See the `cloudfront.ContinuousDeploymentPolicy` resource for additional details.
   593  	ContinuousDeploymentPolicyId *string `pulumi:"continuousDeploymentPolicyId"`
   594  	// One or more custom error response elements (multiples allowed).
   595  	CustomErrorResponses []DistributionCustomErrorResponse `pulumi:"customErrorResponses"`
   596  	// Default cache behavior for this distribution (maximum one). Requires either `cachePolicyId` (preferred) or `forwardedValues` (deprecated) be set.
   597  	DefaultCacheBehavior DistributionDefaultCacheBehavior `pulumi:"defaultCacheBehavior"`
   598  	// Object that you want CloudFront to return (for example, index.html) when an end user requests the root URL.
   599  	DefaultRootObject *string `pulumi:"defaultRootObject"`
   600  	// Whether Origin Shield is enabled.
   601  	Enabled bool `pulumi:"enabled"`
   602  	// Maximum HTTP version to support on the distribution. Allowed values are `http1.1`, `http2`, `http2and3` and `http3`. The default is `http2`.
   603  	HttpVersion *string `pulumi:"httpVersion"`
   604  	// Whether the IPv6 is enabled for the distribution.
   605  	IsIpv6Enabled *bool `pulumi:"isIpv6Enabled"`
   606  	// The logging configuration that controls how logs are written to your distribution (maximum one).
   607  	LoggingConfig *DistributionLoggingConfig `pulumi:"loggingConfig"`
   608  	// Ordered list of cache behaviors resource for this distribution. List from top to bottom in order of precedence. The topmost cache behavior will have precedence 0.
   609  	OrderedCacheBehaviors []DistributionOrderedCacheBehavior `pulumi:"orderedCacheBehaviors"`
   610  	// One or more originGroup for this distribution (multiples allowed).
   611  	OriginGroups []DistributionOriginGroup `pulumi:"originGroups"`
   612  	// One or more origins for this distribution (multiples allowed).
   613  	Origins []DistributionOrigin `pulumi:"origins"`
   614  	// Price class for this distribution. One of `PriceClass_All`, `PriceClass_200`, `PriceClass_100`.
   615  	PriceClass *string `pulumi:"priceClass"`
   616  	// The restriction configuration for this distribution (maximum one).
   617  	Restrictions DistributionRestrictions `pulumi:"restrictions"`
   618  	// Disables the distribution instead of deleting it when destroying the resource through the provider. If this is set, the distribution needs to be deleted manually afterwards. Default: `false`.
   619  	RetainOnDelete *bool `pulumi:"retainOnDelete"`
   620  	// A Boolean that indicates whether this is a staging distribution. Defaults to `false`.
   621  	Staging *bool `pulumi:"staging"`
   622  	// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   623  	Tags map[string]string `pulumi:"tags"`
   624  	// The SSL configuration for this distribution (maximum one).
   625  	ViewerCertificate DistributionViewerCertificate `pulumi:"viewerCertificate"`
   626  	// If enabled, the resource will wait for the distribution status to change from `InProgress` to `Deployed`. Setting this to`false` will skip the process. Default: `true`.
   627  	WaitForDeployment *bool `pulumi:"waitForDeployment"`
   628  	// Unique identifier that specifies the AWS WAF web ACL, if any, to associate with this distribution. To specify a web ACL created using the latest version of AWS WAF (WAFv2), use the ACL ARN, for example `aws_wafv2_web_acl.example.arn`. To specify a web ACL created using AWS WAF Classic, use the ACL ID, for example `aws_waf_web_acl.example.id`. The WAF Web ACL must exist in the WAF Global (CloudFront) region and the credentials configuring this argument must have `waf:GetWebACL` permissions assigned.
   629  	WebAclId *string `pulumi:"webAclId"`
   630  }
   631  
   632  // The set of arguments for constructing a Distribution resource.
   633  type DistributionArgs struct {
   634  	// Extra CNAMEs (alternate domain names), if any, for this distribution.
   635  	Aliases pulumi.StringArrayInput
   636  	// Any comments you want to include about the distribution.
   637  	Comment pulumi.StringPtrInput
   638  	// Identifier of a continuous deployment policy. This argument should only be set on a production distribution. See the `cloudfront.ContinuousDeploymentPolicy` resource for additional details.
   639  	ContinuousDeploymentPolicyId pulumi.StringPtrInput
   640  	// One or more custom error response elements (multiples allowed).
   641  	CustomErrorResponses DistributionCustomErrorResponseArrayInput
   642  	// Default cache behavior for this distribution (maximum one). Requires either `cachePolicyId` (preferred) or `forwardedValues` (deprecated) be set.
   643  	DefaultCacheBehavior DistributionDefaultCacheBehaviorInput
   644  	// Object that you want CloudFront to return (for example, index.html) when an end user requests the root URL.
   645  	DefaultRootObject pulumi.StringPtrInput
   646  	// Whether Origin Shield is enabled.
   647  	Enabled pulumi.BoolInput
   648  	// Maximum HTTP version to support on the distribution. Allowed values are `http1.1`, `http2`, `http2and3` and `http3`. The default is `http2`.
   649  	HttpVersion pulumi.StringPtrInput
   650  	// Whether the IPv6 is enabled for the distribution.
   651  	IsIpv6Enabled pulumi.BoolPtrInput
   652  	// The logging configuration that controls how logs are written to your distribution (maximum one).
   653  	LoggingConfig DistributionLoggingConfigPtrInput
   654  	// Ordered list of cache behaviors resource for this distribution. List from top to bottom in order of precedence. The topmost cache behavior will have precedence 0.
   655  	OrderedCacheBehaviors DistributionOrderedCacheBehaviorArrayInput
   656  	// One or more originGroup for this distribution (multiples allowed).
   657  	OriginGroups DistributionOriginGroupArrayInput
   658  	// One or more origins for this distribution (multiples allowed).
   659  	Origins DistributionOriginArrayInput
   660  	// Price class for this distribution. One of `PriceClass_All`, `PriceClass_200`, `PriceClass_100`.
   661  	PriceClass pulumi.StringPtrInput
   662  	// The restriction configuration for this distribution (maximum one).
   663  	Restrictions DistributionRestrictionsInput
   664  	// Disables the distribution instead of deleting it when destroying the resource through the provider. If this is set, the distribution needs to be deleted manually afterwards. Default: `false`.
   665  	RetainOnDelete pulumi.BoolPtrInput
   666  	// A Boolean that indicates whether this is a staging distribution. Defaults to `false`.
   667  	Staging pulumi.BoolPtrInput
   668  	// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   669  	Tags pulumi.StringMapInput
   670  	// The SSL configuration for this distribution (maximum one).
   671  	ViewerCertificate DistributionViewerCertificateInput
   672  	// If enabled, the resource will wait for the distribution status to change from `InProgress` to `Deployed`. Setting this to`false` will skip the process. Default: `true`.
   673  	WaitForDeployment pulumi.BoolPtrInput
   674  	// Unique identifier that specifies the AWS WAF web ACL, if any, to associate with this distribution. To specify a web ACL created using the latest version of AWS WAF (WAFv2), use the ACL ARN, for example `aws_wafv2_web_acl.example.arn`. To specify a web ACL created using AWS WAF Classic, use the ACL ID, for example `aws_waf_web_acl.example.id`. The WAF Web ACL must exist in the WAF Global (CloudFront) region and the credentials configuring this argument must have `waf:GetWebACL` permissions assigned.
   675  	WebAclId pulumi.StringPtrInput
   676  }
   677  
   678  func (DistributionArgs) ElementType() reflect.Type {
   679  	return reflect.TypeOf((*distributionArgs)(nil)).Elem()
   680  }
   681  
   682  type DistributionInput interface {
   683  	pulumi.Input
   684  
   685  	ToDistributionOutput() DistributionOutput
   686  	ToDistributionOutputWithContext(ctx context.Context) DistributionOutput
   687  }
   688  
   689  func (*Distribution) ElementType() reflect.Type {
   690  	return reflect.TypeOf((**Distribution)(nil)).Elem()
   691  }
   692  
   693  func (i *Distribution) ToDistributionOutput() DistributionOutput {
   694  	return i.ToDistributionOutputWithContext(context.Background())
   695  }
   696  
   697  func (i *Distribution) ToDistributionOutputWithContext(ctx context.Context) DistributionOutput {
   698  	return pulumi.ToOutputWithContext(ctx, i).(DistributionOutput)
   699  }
   700  
   701  // DistributionArrayInput is an input type that accepts DistributionArray and DistributionArrayOutput values.
   702  // You can construct a concrete instance of `DistributionArrayInput` via:
   703  //
   704  //	DistributionArray{ DistributionArgs{...} }
   705  type DistributionArrayInput interface {
   706  	pulumi.Input
   707  
   708  	ToDistributionArrayOutput() DistributionArrayOutput
   709  	ToDistributionArrayOutputWithContext(context.Context) DistributionArrayOutput
   710  }
   711  
   712  type DistributionArray []DistributionInput
   713  
   714  func (DistributionArray) ElementType() reflect.Type {
   715  	return reflect.TypeOf((*[]*Distribution)(nil)).Elem()
   716  }
   717  
   718  func (i DistributionArray) ToDistributionArrayOutput() DistributionArrayOutput {
   719  	return i.ToDistributionArrayOutputWithContext(context.Background())
   720  }
   721  
   722  func (i DistributionArray) ToDistributionArrayOutputWithContext(ctx context.Context) DistributionArrayOutput {
   723  	return pulumi.ToOutputWithContext(ctx, i).(DistributionArrayOutput)
   724  }
   725  
   726  // DistributionMapInput is an input type that accepts DistributionMap and DistributionMapOutput values.
   727  // You can construct a concrete instance of `DistributionMapInput` via:
   728  //
   729  //	DistributionMap{ "key": DistributionArgs{...} }
   730  type DistributionMapInput interface {
   731  	pulumi.Input
   732  
   733  	ToDistributionMapOutput() DistributionMapOutput
   734  	ToDistributionMapOutputWithContext(context.Context) DistributionMapOutput
   735  }
   736  
   737  type DistributionMap map[string]DistributionInput
   738  
   739  func (DistributionMap) ElementType() reflect.Type {
   740  	return reflect.TypeOf((*map[string]*Distribution)(nil)).Elem()
   741  }
   742  
   743  func (i DistributionMap) ToDistributionMapOutput() DistributionMapOutput {
   744  	return i.ToDistributionMapOutputWithContext(context.Background())
   745  }
   746  
   747  func (i DistributionMap) ToDistributionMapOutputWithContext(ctx context.Context) DistributionMapOutput {
   748  	return pulumi.ToOutputWithContext(ctx, i).(DistributionMapOutput)
   749  }
   750  
   751  type DistributionOutput struct{ *pulumi.OutputState }
   752  
   753  func (DistributionOutput) ElementType() reflect.Type {
   754  	return reflect.TypeOf((**Distribution)(nil)).Elem()
   755  }
   756  
   757  func (o DistributionOutput) ToDistributionOutput() DistributionOutput {
   758  	return o
   759  }
   760  
   761  func (o DistributionOutput) ToDistributionOutputWithContext(ctx context.Context) DistributionOutput {
   762  	return o
   763  }
   764  
   765  // Extra CNAMEs (alternate domain names), if any, for this distribution.
   766  func (o DistributionOutput) Aliases() pulumi.StringArrayOutput {
   767  	return o.ApplyT(func(v *Distribution) pulumi.StringArrayOutput { return v.Aliases }).(pulumi.StringArrayOutput)
   768  }
   769  
   770  // ARN for the distribution. For example: `arn:aws:cloudfront::123456789012:distribution/EDFDVBD632BHDS5`, where `123456789012` is your AWS account ID.
   771  func (o DistributionOutput) Arn() pulumi.StringOutput {
   772  	return o.ApplyT(func(v *Distribution) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   773  }
   774  
   775  // Internal value used by CloudFront to allow future updates to the distribution configuration.
   776  func (o DistributionOutput) CallerReference() pulumi.StringOutput {
   777  	return o.ApplyT(func(v *Distribution) pulumi.StringOutput { return v.CallerReference }).(pulumi.StringOutput)
   778  }
   779  
   780  // Any comments you want to include about the distribution.
   781  func (o DistributionOutput) Comment() pulumi.StringPtrOutput {
   782  	return o.ApplyT(func(v *Distribution) pulumi.StringPtrOutput { return v.Comment }).(pulumi.StringPtrOutput)
   783  }
   784  
   785  // Identifier of a continuous deployment policy. This argument should only be set on a production distribution. See the `cloudfront.ContinuousDeploymentPolicy` resource for additional details.
   786  func (o DistributionOutput) ContinuousDeploymentPolicyId() pulumi.StringOutput {
   787  	return o.ApplyT(func(v *Distribution) pulumi.StringOutput { return v.ContinuousDeploymentPolicyId }).(pulumi.StringOutput)
   788  }
   789  
   790  // One or more custom error response elements (multiples allowed).
   791  func (o DistributionOutput) CustomErrorResponses() DistributionCustomErrorResponseArrayOutput {
   792  	return o.ApplyT(func(v *Distribution) DistributionCustomErrorResponseArrayOutput { return v.CustomErrorResponses }).(DistributionCustomErrorResponseArrayOutput)
   793  }
   794  
   795  // Default cache behavior for this distribution (maximum one). Requires either `cachePolicyId` (preferred) or `forwardedValues` (deprecated) be set.
   796  func (o DistributionOutput) DefaultCacheBehavior() DistributionDefaultCacheBehaviorOutput {
   797  	return o.ApplyT(func(v *Distribution) DistributionDefaultCacheBehaviorOutput { return v.DefaultCacheBehavior }).(DistributionDefaultCacheBehaviorOutput)
   798  }
   799  
   800  // Object that you want CloudFront to return (for example, index.html) when an end user requests the root URL.
   801  func (o DistributionOutput) DefaultRootObject() pulumi.StringPtrOutput {
   802  	return o.ApplyT(func(v *Distribution) pulumi.StringPtrOutput { return v.DefaultRootObject }).(pulumi.StringPtrOutput)
   803  }
   804  
   805  // DNS domain name of either the S3 bucket, or web site of your custom origin.
   806  func (o DistributionOutput) DomainName() pulumi.StringOutput {
   807  	return o.ApplyT(func(v *Distribution) pulumi.StringOutput { return v.DomainName }).(pulumi.StringOutput)
   808  }
   809  
   810  // Whether Origin Shield is enabled.
   811  func (o DistributionOutput) Enabled() pulumi.BoolOutput {
   812  	return o.ApplyT(func(v *Distribution) pulumi.BoolOutput { return v.Enabled }).(pulumi.BoolOutput)
   813  }
   814  
   815  // Current version of the distribution's information. For example: `E2QWRUHAPOMQZL`.
   816  func (o DistributionOutput) Etag() pulumi.StringOutput {
   817  	return o.ApplyT(func(v *Distribution) pulumi.StringOutput { return v.Etag }).(pulumi.StringOutput)
   818  }
   819  
   820  // CloudFront Route 53 zone ID that can be used to route an [Alias Resource Record Set](http://docs.aws.amazon.com/Route53/latest/APIReference/CreateAliasRRSAPI.html) to. This attribute is simply an alias for the zone ID `Z2FDTNDATAQYW2`.
   821  func (o DistributionOutput) HostedZoneId() pulumi.StringOutput {
   822  	return o.ApplyT(func(v *Distribution) pulumi.StringOutput { return v.HostedZoneId }).(pulumi.StringOutput)
   823  }
   824  
   825  // Maximum HTTP version to support on the distribution. Allowed values are `http1.1`, `http2`, `http2and3` and `http3`. The default is `http2`.
   826  func (o DistributionOutput) HttpVersion() pulumi.StringPtrOutput {
   827  	return o.ApplyT(func(v *Distribution) pulumi.StringPtrOutput { return v.HttpVersion }).(pulumi.StringPtrOutput)
   828  }
   829  
   830  // Number of invalidation batches currently in progress.
   831  func (o DistributionOutput) InProgressValidationBatches() pulumi.IntOutput {
   832  	return o.ApplyT(func(v *Distribution) pulumi.IntOutput { return v.InProgressValidationBatches }).(pulumi.IntOutput)
   833  }
   834  
   835  // Whether the IPv6 is enabled for the distribution.
   836  func (o DistributionOutput) IsIpv6Enabled() pulumi.BoolPtrOutput {
   837  	return o.ApplyT(func(v *Distribution) pulumi.BoolPtrOutput { return v.IsIpv6Enabled }).(pulumi.BoolPtrOutput)
   838  }
   839  
   840  // Date and time the distribution was last modified.
   841  func (o DistributionOutput) LastModifiedTime() pulumi.StringOutput {
   842  	return o.ApplyT(func(v *Distribution) pulumi.StringOutput { return v.LastModifiedTime }).(pulumi.StringOutput)
   843  }
   844  
   845  // The logging configuration that controls how logs are written to your distribution (maximum one).
   846  func (o DistributionOutput) LoggingConfig() DistributionLoggingConfigPtrOutput {
   847  	return o.ApplyT(func(v *Distribution) DistributionLoggingConfigPtrOutput { return v.LoggingConfig }).(DistributionLoggingConfigPtrOutput)
   848  }
   849  
   850  // Ordered list of cache behaviors resource for this distribution. List from top to bottom in order of precedence. The topmost cache behavior will have precedence 0.
   851  func (o DistributionOutput) OrderedCacheBehaviors() DistributionOrderedCacheBehaviorArrayOutput {
   852  	return o.ApplyT(func(v *Distribution) DistributionOrderedCacheBehaviorArrayOutput { return v.OrderedCacheBehaviors }).(DistributionOrderedCacheBehaviorArrayOutput)
   853  }
   854  
   855  // One or more originGroup for this distribution (multiples allowed).
   856  func (o DistributionOutput) OriginGroups() DistributionOriginGroupArrayOutput {
   857  	return o.ApplyT(func(v *Distribution) DistributionOriginGroupArrayOutput { return v.OriginGroups }).(DistributionOriginGroupArrayOutput)
   858  }
   859  
   860  // One or more origins for this distribution (multiples allowed).
   861  func (o DistributionOutput) Origins() DistributionOriginArrayOutput {
   862  	return o.ApplyT(func(v *Distribution) DistributionOriginArrayOutput { return v.Origins }).(DistributionOriginArrayOutput)
   863  }
   864  
   865  // Price class for this distribution. One of `PriceClass_All`, `PriceClass_200`, `PriceClass_100`.
   866  func (o DistributionOutput) PriceClass() pulumi.StringPtrOutput {
   867  	return o.ApplyT(func(v *Distribution) pulumi.StringPtrOutput { return v.PriceClass }).(pulumi.StringPtrOutput)
   868  }
   869  
   870  // The restriction configuration for this distribution (maximum one).
   871  func (o DistributionOutput) Restrictions() DistributionRestrictionsOutput {
   872  	return o.ApplyT(func(v *Distribution) DistributionRestrictionsOutput { return v.Restrictions }).(DistributionRestrictionsOutput)
   873  }
   874  
   875  // Disables the distribution instead of deleting it when destroying the resource through the provider. If this is set, the distribution needs to be deleted manually afterwards. Default: `false`.
   876  func (o DistributionOutput) RetainOnDelete() pulumi.BoolPtrOutput {
   877  	return o.ApplyT(func(v *Distribution) pulumi.BoolPtrOutput { return v.RetainOnDelete }).(pulumi.BoolPtrOutput)
   878  }
   879  
   880  // A Boolean that indicates whether this is a staging distribution. Defaults to `false`.
   881  func (o DistributionOutput) Staging() pulumi.BoolPtrOutput {
   882  	return o.ApplyT(func(v *Distribution) pulumi.BoolPtrOutput { return v.Staging }).(pulumi.BoolPtrOutput)
   883  }
   884  
   885  // Current status of the distribution. `Deployed` if the distribution's information is fully propagated throughout the Amazon CloudFront system.
   886  func (o DistributionOutput) Status() pulumi.StringOutput {
   887  	return o.ApplyT(func(v *Distribution) pulumi.StringOutput { return v.Status }).(pulumi.StringOutput)
   888  }
   889  
   890  // A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   891  func (o DistributionOutput) Tags() pulumi.StringMapOutput {
   892  	return o.ApplyT(func(v *Distribution) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   893  }
   894  
   895  // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   896  //
   897  // Deprecated: Please use `tags` instead.
   898  func (o DistributionOutput) TagsAll() pulumi.StringMapOutput {
   899  	return o.ApplyT(func(v *Distribution) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   900  }
   901  
   902  // List of key group IDs that CloudFront can use to validate signed URLs or signed cookies. See the [CloudFront User Guide](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-trusted-signers.html) for more information about this feature.
   903  func (o DistributionOutput) TrustedKeyGroups() DistributionTrustedKeyGroupArrayOutput {
   904  	return o.ApplyT(func(v *Distribution) DistributionTrustedKeyGroupArrayOutput { return v.TrustedKeyGroups }).(DistributionTrustedKeyGroupArrayOutput)
   905  }
   906  
   907  // List of AWS account IDs (or `self`) that you want to allow to create signed URLs for private content. See the [CloudFront User Guide](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-trusted-signers.html) for more information about this feature.
   908  func (o DistributionOutput) TrustedSigners() DistributionTrustedSignerArrayOutput {
   909  	return o.ApplyT(func(v *Distribution) DistributionTrustedSignerArrayOutput { return v.TrustedSigners }).(DistributionTrustedSignerArrayOutput)
   910  }
   911  
   912  // The SSL configuration for this distribution (maximum one).
   913  func (o DistributionOutput) ViewerCertificate() DistributionViewerCertificateOutput {
   914  	return o.ApplyT(func(v *Distribution) DistributionViewerCertificateOutput { return v.ViewerCertificate }).(DistributionViewerCertificateOutput)
   915  }
   916  
   917  // If enabled, the resource will wait for the distribution status to change from `InProgress` to `Deployed`. Setting this to`false` will skip the process. Default: `true`.
   918  func (o DistributionOutput) WaitForDeployment() pulumi.BoolPtrOutput {
   919  	return o.ApplyT(func(v *Distribution) pulumi.BoolPtrOutput { return v.WaitForDeployment }).(pulumi.BoolPtrOutput)
   920  }
   921  
   922  // Unique identifier that specifies the AWS WAF web ACL, if any, to associate with this distribution. To specify a web ACL created using the latest version of AWS WAF (WAFv2), use the ACL ARN, for example `aws_wafv2_web_acl.example.arn`. To specify a web ACL created using AWS WAF Classic, use the ACL ID, for example `aws_waf_web_acl.example.id`. The WAF Web ACL must exist in the WAF Global (CloudFront) region and the credentials configuring this argument must have `waf:GetWebACL` permissions assigned.
   923  func (o DistributionOutput) WebAclId() pulumi.StringPtrOutput {
   924  	return o.ApplyT(func(v *Distribution) pulumi.StringPtrOutput { return v.WebAclId }).(pulumi.StringPtrOutput)
   925  }
   926  
   927  type DistributionArrayOutput struct{ *pulumi.OutputState }
   928  
   929  func (DistributionArrayOutput) ElementType() reflect.Type {
   930  	return reflect.TypeOf((*[]*Distribution)(nil)).Elem()
   931  }
   932  
   933  func (o DistributionArrayOutput) ToDistributionArrayOutput() DistributionArrayOutput {
   934  	return o
   935  }
   936  
   937  func (o DistributionArrayOutput) ToDistributionArrayOutputWithContext(ctx context.Context) DistributionArrayOutput {
   938  	return o
   939  }
   940  
   941  func (o DistributionArrayOutput) Index(i pulumi.IntInput) DistributionOutput {
   942  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Distribution {
   943  		return vs[0].([]*Distribution)[vs[1].(int)]
   944  	}).(DistributionOutput)
   945  }
   946  
   947  type DistributionMapOutput struct{ *pulumi.OutputState }
   948  
   949  func (DistributionMapOutput) ElementType() reflect.Type {
   950  	return reflect.TypeOf((*map[string]*Distribution)(nil)).Elem()
   951  }
   952  
   953  func (o DistributionMapOutput) ToDistributionMapOutput() DistributionMapOutput {
   954  	return o
   955  }
   956  
   957  func (o DistributionMapOutput) ToDistributionMapOutputWithContext(ctx context.Context) DistributionMapOutput {
   958  	return o
   959  }
   960  
   961  func (o DistributionMapOutput) MapIndex(k pulumi.StringInput) DistributionOutput {
   962  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Distribution {
   963  		return vs[0].(map[string]*Distribution)[vs[1].(string)]
   964  	}).(DistributionOutput)
   965  }
   966  
   967  func init() {
   968  	pulumi.RegisterInputType(reflect.TypeOf((*DistributionInput)(nil)).Elem(), &Distribution{})
   969  	pulumi.RegisterInputType(reflect.TypeOf((*DistributionArrayInput)(nil)).Elem(), DistributionArray{})
   970  	pulumi.RegisterInputType(reflect.TypeOf((*DistributionMapInput)(nil)).Elem(), DistributionMap{})
   971  	pulumi.RegisterOutputType(DistributionOutput{})
   972  	pulumi.RegisterOutputType(DistributionArrayOutput{})
   973  	pulumi.RegisterOutputType(DistributionMapOutput{})
   974  }