github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/lightsail/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 lightsail 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 // Resource for managing an AWS Lightsail Distribution. 16 // 17 // ## Example Usage 18 // 19 // ### Basic Usage 20 // 21 // Below is a basic example with a bucket as an origin. 22 // 23 // <!--Start PulumiCodeChooser --> 24 // ```go 25 // package main 26 // 27 // import ( 28 // 29 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/lightsail" 30 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 31 // 32 // ) 33 // 34 // func main() { 35 // pulumi.Run(func(ctx *pulumi.Context) error { 36 // test, err := lightsail.NewBucket(ctx, "test", &lightsail.BucketArgs{ 37 // Name: pulumi.String("test-bucket"), 38 // BundleId: pulumi.String("small_1_0"), 39 // }) 40 // if err != nil { 41 // return err 42 // } 43 // _, err = lightsail.NewDistribution(ctx, "test", &lightsail.DistributionArgs{ 44 // Name: pulumi.String("test-distribution"), 45 // BundleId: pulumi.String("small_1_0"), 46 // Origin: &lightsail.DistributionOriginArgs{ 47 // Name: test.Name, 48 // RegionName: test.Region, 49 // }, 50 // DefaultCacheBehavior: &lightsail.DistributionDefaultCacheBehaviorArgs{ 51 // Behavior: pulumi.String("cache"), 52 // }, 53 // CacheBehaviorSettings: &lightsail.DistributionCacheBehaviorSettingsArgs{ 54 // AllowedHttpMethods: pulumi.String("GET,HEAD,OPTIONS,PUT,PATCH,POST,DELETE"), 55 // CachedHttpMethods: pulumi.String("GET,HEAD"), 56 // DefaultTtl: pulumi.Int(86400), 57 // MaximumTtl: pulumi.Int(31536000), 58 // MinimumTtl: pulumi.Int(0), 59 // ForwardedCookies: &lightsail.DistributionCacheBehaviorSettingsForwardedCookiesArgs{ 60 // Option: pulumi.String("none"), 61 // }, 62 // ForwardedHeaders: &lightsail.DistributionCacheBehaviorSettingsForwardedHeadersArgs{ 63 // Option: pulumi.String("default"), 64 // }, 65 // ForwardedQueryStrings: &lightsail.DistributionCacheBehaviorSettingsForwardedQueryStringsArgs{ 66 // Option: pulumi.Bool(false), 67 // }, 68 // }, 69 // }) 70 // if err != nil { 71 // return err 72 // } 73 // return nil 74 // }) 75 // } 76 // 77 // ``` 78 // <!--End PulumiCodeChooser --> 79 // 80 // ### instance origin example 81 // 82 // Below is an example of an instance as the origin. 83 // 84 // <!--Start PulumiCodeChooser --> 85 // ```go 86 // package main 87 // 88 // import ( 89 // 90 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws" 91 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/lightsail" 92 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 93 // 94 // ) 95 // 96 // func main() { 97 // pulumi.Run(func(ctx *pulumi.Context) error { 98 // available, err := aws.GetAvailabilityZones(ctx, &aws.GetAvailabilityZonesArgs{ 99 // State: pulumi.StringRef("available"), 100 // Filters: []aws.GetAvailabilityZonesFilter{ 101 // { 102 // Name: "opt-in-status", 103 // Values: []string{ 104 // "opt-in-not-required", 105 // }, 106 // }, 107 // }, 108 // }, nil) 109 // if err != nil { 110 // return err 111 // } 112 // testStaticIp, err := lightsail.NewStaticIp(ctx, "test", &lightsail.StaticIpArgs{ 113 // Name: pulumi.String("test-static-ip"), 114 // }) 115 // if err != nil { 116 // return err 117 // } 118 // testInstance, err := lightsail.NewInstance(ctx, "test", &lightsail.InstanceArgs{ 119 // Name: pulumi.String("test-instance"), 120 // AvailabilityZone: pulumi.String(available.Names[0]), 121 // BlueprintId: pulumi.String("amazon_linux_2"), 122 // BundleId: pulumi.String("micro_1_0"), 123 // }) 124 // if err != nil { 125 // return err 126 // } 127 // test, err := lightsail.NewStaticIpAttachment(ctx, "test", &lightsail.StaticIpAttachmentArgs{ 128 // StaticIpName: testStaticIp.Name, 129 // InstanceName: testInstance.Name, 130 // }) 131 // if err != nil { 132 // return err 133 // } 134 // _, err = lightsail.NewDistribution(ctx, "test", &lightsail.DistributionArgs{ 135 // Name: pulumi.String("test-distribution"), 136 // BundleId: pulumi.String("small_1_0"), 137 // Origin: &lightsail.DistributionOriginArgs{ 138 // Name: testInstance.Name, 139 // RegionName: pulumi.String(available.Id), 140 // }, 141 // DefaultCacheBehavior: &lightsail.DistributionDefaultCacheBehaviorArgs{ 142 // Behavior: pulumi.String("cache"), 143 // }, 144 // }, pulumi.DependsOn([]pulumi.Resource{ 145 // test, 146 // })) 147 // if err != nil { 148 // return err 149 // } 150 // return nil 151 // }) 152 // } 153 // 154 // ``` 155 // <!--End PulumiCodeChooser --> 156 // 157 // ### lb origin example 158 // 159 // # Below is an example with a load balancer as an origin 160 // 161 // <!--Start PulumiCodeChooser --> 162 // ```go 163 // package main 164 // 165 // import ( 166 // 167 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws" 168 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/lightsail" 169 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 170 // 171 // ) 172 // 173 // func main() { 174 // pulumi.Run(func(ctx *pulumi.Context) error { 175 // available, err := aws.GetAvailabilityZones(ctx, &aws.GetAvailabilityZonesArgs{ 176 // State: pulumi.StringRef("available"), 177 // Filters: []aws.GetAvailabilityZonesFilter{ 178 // { 179 // Name: "opt-in-status", 180 // Values: []string{ 181 // "opt-in-not-required", 182 // }, 183 // }, 184 // }, 185 // }, nil) 186 // if err != nil { 187 // return err 188 // } 189 // test, err := lightsail.NewLb(ctx, "test", &lightsail.LbArgs{ 190 // Name: pulumi.String("test-load-balancer"), 191 // HealthCheckPath: pulumi.String("/"), 192 // InstancePort: pulumi.Int(80), 193 // Tags: pulumi.StringMap{ 194 // "foo": pulumi.String("bar"), 195 // }, 196 // }) 197 // if err != nil { 198 // return err 199 // } 200 // testInstance, err := lightsail.NewInstance(ctx, "test", &lightsail.InstanceArgs{ 201 // Name: pulumi.String("test-instance"), 202 // AvailabilityZone: pulumi.String(available.Names[0]), 203 // BlueprintId: pulumi.String("amazon_linux_2"), 204 // BundleId: pulumi.String("nano_3_0"), 205 // }) 206 // if err != nil { 207 // return err 208 // } 209 // testLbAttachment, err := lightsail.NewLbAttachment(ctx, "test", &lightsail.LbAttachmentArgs{ 210 // LbName: test.Name, 211 // InstanceName: testInstance.Name, 212 // }) 213 // if err != nil { 214 // return err 215 // } 216 // _, err = lightsail.NewDistribution(ctx, "test", &lightsail.DistributionArgs{ 217 // Name: pulumi.String("test-distribution"), 218 // BundleId: pulumi.String("small_1_0"), 219 // Origin: &lightsail.DistributionOriginArgs{ 220 // Name: test.Name, 221 // RegionName: pulumi.String(available.Id), 222 // }, 223 // DefaultCacheBehavior: &lightsail.DistributionDefaultCacheBehaviorArgs{ 224 // Behavior: pulumi.String("cache"), 225 // }, 226 // }, pulumi.DependsOn([]pulumi.Resource{ 227 // testLbAttachment, 228 // })) 229 // if err != nil { 230 // return err 231 // } 232 // return nil 233 // }) 234 // } 235 // 236 // ``` 237 // <!--End PulumiCodeChooser --> 238 // 239 // ## Import 240 // 241 // Using `pulumi import`, import Lightsail Distribution using the `id`. For example: 242 // 243 // ```sh 244 // $ pulumi import aws:lightsail/distribution:Distribution example rft-8012925589 245 // ``` 246 type Distribution struct { 247 pulumi.CustomResourceState 248 249 // The alternate domain names of the distribution. 250 AlternativeDomainNames pulumi.StringArrayOutput `pulumi:"alternativeDomainNames"` 251 // The Amazon Resource Name (ARN) of the distribution. 252 Arn pulumi.StringOutput `pulumi:"arn"` 253 // Bundle ID to use for the distribution. 254 BundleId pulumi.StringOutput `pulumi:"bundleId"` 255 // An object that describes the cache behavior settings of the distribution. Detailed below 256 // 257 // The following arguments are optional: 258 CacheBehaviorSettings DistributionCacheBehaviorSettingsPtrOutput `pulumi:"cacheBehaviorSettings"` 259 // A set of configuration blocks that describe the per-path cache behavior of the distribution. Detailed below 260 CacheBehaviors DistributionCacheBehaviorArrayOutput `pulumi:"cacheBehaviors"` 261 // The name of the SSL/TLS certificate attached to the distribution, if any. 262 CertificateName pulumi.StringPtrOutput `pulumi:"certificateName"` 263 // The timestamp when the distribution was created. 264 CreatedAt pulumi.StringOutput `pulumi:"createdAt"` 265 // Object that describes the default cache behavior of the distribution. Detailed below 266 DefaultCacheBehavior DistributionDefaultCacheBehaviorOutput `pulumi:"defaultCacheBehavior"` 267 // The domain name of the distribution. 268 DomainName pulumi.StringOutput `pulumi:"domainName"` 269 // The IP address type of the distribution. Default: `dualstack`. 270 IpAddressType pulumi.StringPtrOutput `pulumi:"ipAddressType"` 271 // Indicates whether the distribution is enabled. Default: `true`. 272 IsEnabled pulumi.BoolPtrOutput `pulumi:"isEnabled"` 273 // An object that describes the location of the distribution, such as the AWS Region and Availability Zone. Detailed below 274 Locations DistributionLocationArrayOutput `pulumi:"locations"` 275 // Name of the distribution. 276 Name pulumi.StringOutput `pulumi:"name"` 277 // Object that describes the origin resource of the distribution, such as a Lightsail instance, bucket, or load balancer. Detailed below 278 Origin DistributionOriginOutput `pulumi:"origin"` 279 // The public DNS of the origin. 280 OriginPublicDns pulumi.StringOutput `pulumi:"originPublicDns"` 281 // The resource type of the origin resource (e.g., Instance). 282 ResourceType pulumi.StringOutput `pulumi:"resourceType"` 283 // The status of the distribution. 284 Status pulumi.StringOutput `pulumi:"status"` 285 // The support code. Include this code in your email to support when you have questions about your Lightsail distribution. This code enables our support team to look up your Lightsail information more easily. 286 SupportCode pulumi.StringOutput `pulumi:"supportCode"` 287 // Map of tags for the Lightsail Distribution. If 288 // configured with a provider 289 // `defaultTags` configuration block 290 // present, tags with matching keys will overwrite those defined at the provider-level. 291 Tags pulumi.StringMapOutput `pulumi:"tags"` 292 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 293 // 294 // Deprecated: Please use `tags` instead. 295 TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"` 296 } 297 298 // NewDistribution registers a new resource with the given unique name, arguments, and options. 299 func NewDistribution(ctx *pulumi.Context, 300 name string, args *DistributionArgs, opts ...pulumi.ResourceOption) (*Distribution, error) { 301 if args == nil { 302 return nil, errors.New("missing one or more required arguments") 303 } 304 305 if args.BundleId == nil { 306 return nil, errors.New("invalid value for required argument 'BundleId'") 307 } 308 if args.DefaultCacheBehavior == nil { 309 return nil, errors.New("invalid value for required argument 'DefaultCacheBehavior'") 310 } 311 if args.Origin == nil { 312 return nil, errors.New("invalid value for required argument 'Origin'") 313 } 314 opts = internal.PkgResourceDefaultOpts(opts) 315 var resource Distribution 316 err := ctx.RegisterResource("aws:lightsail/distribution:Distribution", name, args, &resource, opts...) 317 if err != nil { 318 return nil, err 319 } 320 return &resource, nil 321 } 322 323 // GetDistribution gets an existing Distribution resource's state with the given name, ID, and optional 324 // state properties that are used to uniquely qualify the lookup (nil if not required). 325 func GetDistribution(ctx *pulumi.Context, 326 name string, id pulumi.IDInput, state *DistributionState, opts ...pulumi.ResourceOption) (*Distribution, error) { 327 var resource Distribution 328 err := ctx.ReadResource("aws:lightsail/distribution:Distribution", name, id, state, &resource, opts...) 329 if err != nil { 330 return nil, err 331 } 332 return &resource, nil 333 } 334 335 // Input properties used for looking up and filtering Distribution resources. 336 type distributionState struct { 337 // The alternate domain names of the distribution. 338 AlternativeDomainNames []string `pulumi:"alternativeDomainNames"` 339 // The Amazon Resource Name (ARN) of the distribution. 340 Arn *string `pulumi:"arn"` 341 // Bundle ID to use for the distribution. 342 BundleId *string `pulumi:"bundleId"` 343 // An object that describes the cache behavior settings of the distribution. Detailed below 344 // 345 // The following arguments are optional: 346 CacheBehaviorSettings *DistributionCacheBehaviorSettings `pulumi:"cacheBehaviorSettings"` 347 // A set of configuration blocks that describe the per-path cache behavior of the distribution. Detailed below 348 CacheBehaviors []DistributionCacheBehavior `pulumi:"cacheBehaviors"` 349 // The name of the SSL/TLS certificate attached to the distribution, if any. 350 CertificateName *string `pulumi:"certificateName"` 351 // The timestamp when the distribution was created. 352 CreatedAt *string `pulumi:"createdAt"` 353 // Object that describes the default cache behavior of the distribution. Detailed below 354 DefaultCacheBehavior *DistributionDefaultCacheBehavior `pulumi:"defaultCacheBehavior"` 355 // The domain name of the distribution. 356 DomainName *string `pulumi:"domainName"` 357 // The IP address type of the distribution. Default: `dualstack`. 358 IpAddressType *string `pulumi:"ipAddressType"` 359 // Indicates whether the distribution is enabled. Default: `true`. 360 IsEnabled *bool `pulumi:"isEnabled"` 361 // An object that describes the location of the distribution, such as the AWS Region and Availability Zone. Detailed below 362 Locations []DistributionLocation `pulumi:"locations"` 363 // Name of the distribution. 364 Name *string `pulumi:"name"` 365 // Object that describes the origin resource of the distribution, such as a Lightsail instance, bucket, or load balancer. Detailed below 366 Origin *DistributionOrigin `pulumi:"origin"` 367 // The public DNS of the origin. 368 OriginPublicDns *string `pulumi:"originPublicDns"` 369 // The resource type of the origin resource (e.g., Instance). 370 ResourceType *string `pulumi:"resourceType"` 371 // The status of the distribution. 372 Status *string `pulumi:"status"` 373 // The support code. Include this code in your email to support when you have questions about your Lightsail distribution. This code enables our support team to look up your Lightsail information more easily. 374 SupportCode *string `pulumi:"supportCode"` 375 // Map of tags for the Lightsail Distribution. If 376 // configured with a provider 377 // `defaultTags` configuration block 378 // present, tags with matching keys will overwrite those defined at the provider-level. 379 Tags map[string]string `pulumi:"tags"` 380 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 381 // 382 // Deprecated: Please use `tags` instead. 383 TagsAll map[string]string `pulumi:"tagsAll"` 384 } 385 386 type DistributionState struct { 387 // The alternate domain names of the distribution. 388 AlternativeDomainNames pulumi.StringArrayInput 389 // The Amazon Resource Name (ARN) of the distribution. 390 Arn pulumi.StringPtrInput 391 // Bundle ID to use for the distribution. 392 BundleId pulumi.StringPtrInput 393 // An object that describes the cache behavior settings of the distribution. Detailed below 394 // 395 // The following arguments are optional: 396 CacheBehaviorSettings DistributionCacheBehaviorSettingsPtrInput 397 // A set of configuration blocks that describe the per-path cache behavior of the distribution. Detailed below 398 CacheBehaviors DistributionCacheBehaviorArrayInput 399 // The name of the SSL/TLS certificate attached to the distribution, if any. 400 CertificateName pulumi.StringPtrInput 401 // The timestamp when the distribution was created. 402 CreatedAt pulumi.StringPtrInput 403 // Object that describes the default cache behavior of the distribution. Detailed below 404 DefaultCacheBehavior DistributionDefaultCacheBehaviorPtrInput 405 // The domain name of the distribution. 406 DomainName pulumi.StringPtrInput 407 // The IP address type of the distribution. Default: `dualstack`. 408 IpAddressType pulumi.StringPtrInput 409 // Indicates whether the distribution is enabled. Default: `true`. 410 IsEnabled pulumi.BoolPtrInput 411 // An object that describes the location of the distribution, such as the AWS Region and Availability Zone. Detailed below 412 Locations DistributionLocationArrayInput 413 // Name of the distribution. 414 Name pulumi.StringPtrInput 415 // Object that describes the origin resource of the distribution, such as a Lightsail instance, bucket, or load balancer. Detailed below 416 Origin DistributionOriginPtrInput 417 // The public DNS of the origin. 418 OriginPublicDns pulumi.StringPtrInput 419 // The resource type of the origin resource (e.g., Instance). 420 ResourceType pulumi.StringPtrInput 421 // The status of the distribution. 422 Status pulumi.StringPtrInput 423 // The support code. Include this code in your email to support when you have questions about your Lightsail distribution. This code enables our support team to look up your Lightsail information more easily. 424 SupportCode pulumi.StringPtrInput 425 // Map of tags for the Lightsail Distribution. If 426 // configured with a provider 427 // `defaultTags` configuration block 428 // present, tags with matching keys will overwrite those defined at the provider-level. 429 Tags pulumi.StringMapInput 430 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 431 // 432 // Deprecated: Please use `tags` instead. 433 TagsAll pulumi.StringMapInput 434 } 435 436 func (DistributionState) ElementType() reflect.Type { 437 return reflect.TypeOf((*distributionState)(nil)).Elem() 438 } 439 440 type distributionArgs struct { 441 // Bundle ID to use for the distribution. 442 BundleId string `pulumi:"bundleId"` 443 // An object that describes the cache behavior settings of the distribution. Detailed below 444 // 445 // The following arguments are optional: 446 CacheBehaviorSettings *DistributionCacheBehaviorSettings `pulumi:"cacheBehaviorSettings"` 447 // A set of configuration blocks that describe the per-path cache behavior of the distribution. Detailed below 448 CacheBehaviors []DistributionCacheBehavior `pulumi:"cacheBehaviors"` 449 // The name of the SSL/TLS certificate attached to the distribution, if any. 450 CertificateName *string `pulumi:"certificateName"` 451 // Object that describes the default cache behavior of the distribution. Detailed below 452 DefaultCacheBehavior DistributionDefaultCacheBehavior `pulumi:"defaultCacheBehavior"` 453 // The IP address type of the distribution. Default: `dualstack`. 454 IpAddressType *string `pulumi:"ipAddressType"` 455 // Indicates whether the distribution is enabled. Default: `true`. 456 IsEnabled *bool `pulumi:"isEnabled"` 457 // Name of the distribution. 458 Name *string `pulumi:"name"` 459 // Object that describes the origin resource of the distribution, such as a Lightsail instance, bucket, or load balancer. Detailed below 460 Origin DistributionOrigin `pulumi:"origin"` 461 // Map of tags for the Lightsail Distribution. If 462 // configured with a provider 463 // `defaultTags` configuration block 464 // present, tags with matching keys will overwrite those defined at the provider-level. 465 Tags map[string]string `pulumi:"tags"` 466 } 467 468 // The set of arguments for constructing a Distribution resource. 469 type DistributionArgs struct { 470 // Bundle ID to use for the distribution. 471 BundleId pulumi.StringInput 472 // An object that describes the cache behavior settings of the distribution. Detailed below 473 // 474 // The following arguments are optional: 475 CacheBehaviorSettings DistributionCacheBehaviorSettingsPtrInput 476 // A set of configuration blocks that describe the per-path cache behavior of the distribution. Detailed below 477 CacheBehaviors DistributionCacheBehaviorArrayInput 478 // The name of the SSL/TLS certificate attached to the distribution, if any. 479 CertificateName pulumi.StringPtrInput 480 // Object that describes the default cache behavior of the distribution. Detailed below 481 DefaultCacheBehavior DistributionDefaultCacheBehaviorInput 482 // The IP address type of the distribution. Default: `dualstack`. 483 IpAddressType pulumi.StringPtrInput 484 // Indicates whether the distribution is enabled. Default: `true`. 485 IsEnabled pulumi.BoolPtrInput 486 // Name of the distribution. 487 Name pulumi.StringPtrInput 488 // Object that describes the origin resource of the distribution, such as a Lightsail instance, bucket, or load balancer. Detailed below 489 Origin DistributionOriginInput 490 // Map of tags for the Lightsail Distribution. If 491 // configured with a provider 492 // `defaultTags` configuration block 493 // present, tags with matching keys will overwrite those defined at the provider-level. 494 Tags pulumi.StringMapInput 495 } 496 497 func (DistributionArgs) ElementType() reflect.Type { 498 return reflect.TypeOf((*distributionArgs)(nil)).Elem() 499 } 500 501 type DistributionInput interface { 502 pulumi.Input 503 504 ToDistributionOutput() DistributionOutput 505 ToDistributionOutputWithContext(ctx context.Context) DistributionOutput 506 } 507 508 func (*Distribution) ElementType() reflect.Type { 509 return reflect.TypeOf((**Distribution)(nil)).Elem() 510 } 511 512 func (i *Distribution) ToDistributionOutput() DistributionOutput { 513 return i.ToDistributionOutputWithContext(context.Background()) 514 } 515 516 func (i *Distribution) ToDistributionOutputWithContext(ctx context.Context) DistributionOutput { 517 return pulumi.ToOutputWithContext(ctx, i).(DistributionOutput) 518 } 519 520 // DistributionArrayInput is an input type that accepts DistributionArray and DistributionArrayOutput values. 521 // You can construct a concrete instance of `DistributionArrayInput` via: 522 // 523 // DistributionArray{ DistributionArgs{...} } 524 type DistributionArrayInput interface { 525 pulumi.Input 526 527 ToDistributionArrayOutput() DistributionArrayOutput 528 ToDistributionArrayOutputWithContext(context.Context) DistributionArrayOutput 529 } 530 531 type DistributionArray []DistributionInput 532 533 func (DistributionArray) ElementType() reflect.Type { 534 return reflect.TypeOf((*[]*Distribution)(nil)).Elem() 535 } 536 537 func (i DistributionArray) ToDistributionArrayOutput() DistributionArrayOutput { 538 return i.ToDistributionArrayOutputWithContext(context.Background()) 539 } 540 541 func (i DistributionArray) ToDistributionArrayOutputWithContext(ctx context.Context) DistributionArrayOutput { 542 return pulumi.ToOutputWithContext(ctx, i).(DistributionArrayOutput) 543 } 544 545 // DistributionMapInput is an input type that accepts DistributionMap and DistributionMapOutput values. 546 // You can construct a concrete instance of `DistributionMapInput` via: 547 // 548 // DistributionMap{ "key": DistributionArgs{...} } 549 type DistributionMapInput interface { 550 pulumi.Input 551 552 ToDistributionMapOutput() DistributionMapOutput 553 ToDistributionMapOutputWithContext(context.Context) DistributionMapOutput 554 } 555 556 type DistributionMap map[string]DistributionInput 557 558 func (DistributionMap) ElementType() reflect.Type { 559 return reflect.TypeOf((*map[string]*Distribution)(nil)).Elem() 560 } 561 562 func (i DistributionMap) ToDistributionMapOutput() DistributionMapOutput { 563 return i.ToDistributionMapOutputWithContext(context.Background()) 564 } 565 566 func (i DistributionMap) ToDistributionMapOutputWithContext(ctx context.Context) DistributionMapOutput { 567 return pulumi.ToOutputWithContext(ctx, i).(DistributionMapOutput) 568 } 569 570 type DistributionOutput struct{ *pulumi.OutputState } 571 572 func (DistributionOutput) ElementType() reflect.Type { 573 return reflect.TypeOf((**Distribution)(nil)).Elem() 574 } 575 576 func (o DistributionOutput) ToDistributionOutput() DistributionOutput { 577 return o 578 } 579 580 func (o DistributionOutput) ToDistributionOutputWithContext(ctx context.Context) DistributionOutput { 581 return o 582 } 583 584 // The alternate domain names of the distribution. 585 func (o DistributionOutput) AlternativeDomainNames() pulumi.StringArrayOutput { 586 return o.ApplyT(func(v *Distribution) pulumi.StringArrayOutput { return v.AlternativeDomainNames }).(pulumi.StringArrayOutput) 587 } 588 589 // The Amazon Resource Name (ARN) of the distribution. 590 func (o DistributionOutput) Arn() pulumi.StringOutput { 591 return o.ApplyT(func(v *Distribution) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 592 } 593 594 // Bundle ID to use for the distribution. 595 func (o DistributionOutput) BundleId() pulumi.StringOutput { 596 return o.ApplyT(func(v *Distribution) pulumi.StringOutput { return v.BundleId }).(pulumi.StringOutput) 597 } 598 599 // An object that describes the cache behavior settings of the distribution. Detailed below 600 // 601 // The following arguments are optional: 602 func (o DistributionOutput) CacheBehaviorSettings() DistributionCacheBehaviorSettingsPtrOutput { 603 return o.ApplyT(func(v *Distribution) DistributionCacheBehaviorSettingsPtrOutput { return v.CacheBehaviorSettings }).(DistributionCacheBehaviorSettingsPtrOutput) 604 } 605 606 // A set of configuration blocks that describe the per-path cache behavior of the distribution. Detailed below 607 func (o DistributionOutput) CacheBehaviors() DistributionCacheBehaviorArrayOutput { 608 return o.ApplyT(func(v *Distribution) DistributionCacheBehaviorArrayOutput { return v.CacheBehaviors }).(DistributionCacheBehaviorArrayOutput) 609 } 610 611 // The name of the SSL/TLS certificate attached to the distribution, if any. 612 func (o DistributionOutput) CertificateName() pulumi.StringPtrOutput { 613 return o.ApplyT(func(v *Distribution) pulumi.StringPtrOutput { return v.CertificateName }).(pulumi.StringPtrOutput) 614 } 615 616 // The timestamp when the distribution was created. 617 func (o DistributionOutput) CreatedAt() pulumi.StringOutput { 618 return o.ApplyT(func(v *Distribution) pulumi.StringOutput { return v.CreatedAt }).(pulumi.StringOutput) 619 } 620 621 // Object that describes the default cache behavior of the distribution. Detailed below 622 func (o DistributionOutput) DefaultCacheBehavior() DistributionDefaultCacheBehaviorOutput { 623 return o.ApplyT(func(v *Distribution) DistributionDefaultCacheBehaviorOutput { return v.DefaultCacheBehavior }).(DistributionDefaultCacheBehaviorOutput) 624 } 625 626 // The domain name of the distribution. 627 func (o DistributionOutput) DomainName() pulumi.StringOutput { 628 return o.ApplyT(func(v *Distribution) pulumi.StringOutput { return v.DomainName }).(pulumi.StringOutput) 629 } 630 631 // The IP address type of the distribution. Default: `dualstack`. 632 func (o DistributionOutput) IpAddressType() pulumi.StringPtrOutput { 633 return o.ApplyT(func(v *Distribution) pulumi.StringPtrOutput { return v.IpAddressType }).(pulumi.StringPtrOutput) 634 } 635 636 // Indicates whether the distribution is enabled. Default: `true`. 637 func (o DistributionOutput) IsEnabled() pulumi.BoolPtrOutput { 638 return o.ApplyT(func(v *Distribution) pulumi.BoolPtrOutput { return v.IsEnabled }).(pulumi.BoolPtrOutput) 639 } 640 641 // An object that describes the location of the distribution, such as the AWS Region and Availability Zone. Detailed below 642 func (o DistributionOutput) Locations() DistributionLocationArrayOutput { 643 return o.ApplyT(func(v *Distribution) DistributionLocationArrayOutput { return v.Locations }).(DistributionLocationArrayOutput) 644 } 645 646 // Name of the distribution. 647 func (o DistributionOutput) Name() pulumi.StringOutput { 648 return o.ApplyT(func(v *Distribution) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput) 649 } 650 651 // Object that describes the origin resource of the distribution, such as a Lightsail instance, bucket, or load balancer. Detailed below 652 func (o DistributionOutput) Origin() DistributionOriginOutput { 653 return o.ApplyT(func(v *Distribution) DistributionOriginOutput { return v.Origin }).(DistributionOriginOutput) 654 } 655 656 // The public DNS of the origin. 657 func (o DistributionOutput) OriginPublicDns() pulumi.StringOutput { 658 return o.ApplyT(func(v *Distribution) pulumi.StringOutput { return v.OriginPublicDns }).(pulumi.StringOutput) 659 } 660 661 // The resource type of the origin resource (e.g., Instance). 662 func (o DistributionOutput) ResourceType() pulumi.StringOutput { 663 return o.ApplyT(func(v *Distribution) pulumi.StringOutput { return v.ResourceType }).(pulumi.StringOutput) 664 } 665 666 // The status of the distribution. 667 func (o DistributionOutput) Status() pulumi.StringOutput { 668 return o.ApplyT(func(v *Distribution) pulumi.StringOutput { return v.Status }).(pulumi.StringOutput) 669 } 670 671 // The support code. Include this code in your email to support when you have questions about your Lightsail distribution. This code enables our support team to look up your Lightsail information more easily. 672 func (o DistributionOutput) SupportCode() pulumi.StringOutput { 673 return o.ApplyT(func(v *Distribution) pulumi.StringOutput { return v.SupportCode }).(pulumi.StringOutput) 674 } 675 676 // Map of tags for the Lightsail Distribution. If 677 // configured with a provider 678 // `defaultTags` configuration block 679 // present, tags with matching keys will overwrite those defined at the provider-level. 680 func (o DistributionOutput) Tags() pulumi.StringMapOutput { 681 return o.ApplyT(func(v *Distribution) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput) 682 } 683 684 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 685 // 686 // Deprecated: Please use `tags` instead. 687 func (o DistributionOutput) TagsAll() pulumi.StringMapOutput { 688 return o.ApplyT(func(v *Distribution) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput) 689 } 690 691 type DistributionArrayOutput struct{ *pulumi.OutputState } 692 693 func (DistributionArrayOutput) ElementType() reflect.Type { 694 return reflect.TypeOf((*[]*Distribution)(nil)).Elem() 695 } 696 697 func (o DistributionArrayOutput) ToDistributionArrayOutput() DistributionArrayOutput { 698 return o 699 } 700 701 func (o DistributionArrayOutput) ToDistributionArrayOutputWithContext(ctx context.Context) DistributionArrayOutput { 702 return o 703 } 704 705 func (o DistributionArrayOutput) Index(i pulumi.IntInput) DistributionOutput { 706 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Distribution { 707 return vs[0].([]*Distribution)[vs[1].(int)] 708 }).(DistributionOutput) 709 } 710 711 type DistributionMapOutput struct{ *pulumi.OutputState } 712 713 func (DistributionMapOutput) ElementType() reflect.Type { 714 return reflect.TypeOf((*map[string]*Distribution)(nil)).Elem() 715 } 716 717 func (o DistributionMapOutput) ToDistributionMapOutput() DistributionMapOutput { 718 return o 719 } 720 721 func (o DistributionMapOutput) ToDistributionMapOutputWithContext(ctx context.Context) DistributionMapOutput { 722 return o 723 } 724 725 func (o DistributionMapOutput) MapIndex(k pulumi.StringInput) DistributionOutput { 726 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Distribution { 727 return vs[0].(map[string]*Distribution)[vs[1].(string)] 728 }).(DistributionOutput) 729 } 730 731 func init() { 732 pulumi.RegisterInputType(reflect.TypeOf((*DistributionInput)(nil)).Elem(), &Distribution{}) 733 pulumi.RegisterInputType(reflect.TypeOf((*DistributionArrayInput)(nil)).Elem(), DistributionArray{}) 734 pulumi.RegisterInputType(reflect.TypeOf((*DistributionMapInput)(nil)).Elem(), DistributionMap{}) 735 pulumi.RegisterOutputType(DistributionOutput{}) 736 pulumi.RegisterOutputType(DistributionArrayOutput{}) 737 pulumi.RegisterOutputType(DistributionMapOutput{}) 738 }