aws logo
AWS Classic v5.41.0, May 15 23

aws.lightsail.Distribution

Explore with Pulumi AI

Resource for managing an AWS Lightsail Distribution.

Example Usage

Basic Usage

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var testBucket = new Aws.LightSail.Bucket("testBucket", new()
    {
        BundleId = "small_1_0",
    });

    var testDistribution = new Aws.LightSail.Distribution("testDistribution", new()
    {
        BundleId = "small_1_0",
        Origin = new Aws.LightSail.Inputs.DistributionOriginArgs
        {
            Name = testBucket.Name,
            RegionName = testBucket.Region,
        },
        DefaultCacheBehavior = new Aws.LightSail.Inputs.DistributionDefaultCacheBehaviorArgs
        {
            Behavior = "cache",
        },
        CacheBehaviorSettings = new Aws.LightSail.Inputs.DistributionCacheBehaviorSettingsArgs
        {
            AllowedHttpMethods = "GET,HEAD,OPTIONS,PUT,PATCH,POST,DELETE",
            CachedHttpMethods = "GET,HEAD",
            DefaultTtl = 86400,
            MaximumTtl = 31536000,
            MinimumTtl = 0,
            ForwardedCookies = new Aws.LightSail.Inputs.DistributionCacheBehaviorSettingsForwardedCookiesArgs
            {
                Option = "none",
            },
            ForwardedHeaders = new Aws.LightSail.Inputs.DistributionCacheBehaviorSettingsForwardedHeadersArgs
            {
                Option = "default",
            },
            ForwardedQueryStrings = new Aws.LightSail.Inputs.DistributionCacheBehaviorSettingsForwardedQueryStringsArgs
            {
                Option = false,
            },
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/lightsail"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		testBucket, err := lightsail.NewBucket(ctx, "testBucket", &lightsail.BucketArgs{
			BundleId: pulumi.String("small_1_0"),
		})
		if err != nil {
			return err
		}
		_, err = lightsail.NewDistribution(ctx, "testDistribution", &lightsail.DistributionArgs{
			BundleId: pulumi.String("small_1_0"),
			Origin: &lightsail.DistributionOriginArgs{
				Name:       testBucket.Name,
				RegionName: testBucket.Region,
			},
			DefaultCacheBehavior: &lightsail.DistributionDefaultCacheBehaviorArgs{
				Behavior: pulumi.String("cache"),
			},
			CacheBehaviorSettings: &lightsail.DistributionCacheBehaviorSettingsArgs{
				AllowedHttpMethods: pulumi.String("GET,HEAD,OPTIONS,PUT,PATCH,POST,DELETE"),
				CachedHttpMethods:  pulumi.String("GET,HEAD"),
				DefaultTtl:         pulumi.Int(86400),
				MaximumTtl:         pulumi.Int(31536000),
				MinimumTtl:         pulumi.Int(0),
				ForwardedCookies: &lightsail.DistributionCacheBehaviorSettingsForwardedCookiesArgs{
					Option: pulumi.String("none"),
				},
				ForwardedHeaders: &lightsail.DistributionCacheBehaviorSettingsForwardedHeadersArgs{
					Option: pulumi.String("default"),
				},
				ForwardedQueryStrings: &lightsail.DistributionCacheBehaviorSettingsForwardedQueryStringsArgs{
					Option: pulumi.Bool(false),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.lightsail.Bucket;
import com.pulumi.aws.lightsail.BucketArgs;
import com.pulumi.aws.lightsail.Distribution;
import com.pulumi.aws.lightsail.DistributionArgs;
import com.pulumi.aws.lightsail.inputs.DistributionOriginArgs;
import com.pulumi.aws.lightsail.inputs.DistributionDefaultCacheBehaviorArgs;
import com.pulumi.aws.lightsail.inputs.DistributionCacheBehaviorSettingsArgs;
import com.pulumi.aws.lightsail.inputs.DistributionCacheBehaviorSettingsForwardedCookiesArgs;
import com.pulumi.aws.lightsail.inputs.DistributionCacheBehaviorSettingsForwardedHeadersArgs;
import com.pulumi.aws.lightsail.inputs.DistributionCacheBehaviorSettingsForwardedQueryStringsArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var testBucket = new Bucket("testBucket", BucketArgs.builder()        
            .bundleId("small_1_0")
            .build());

        var testDistribution = new Distribution("testDistribution", DistributionArgs.builder()        
            .bundleId("small_1_0")
            .origin(DistributionOriginArgs.builder()
                .name(testBucket.name())
                .regionName(testBucket.region())
                .build())
            .defaultCacheBehavior(DistributionDefaultCacheBehaviorArgs.builder()
                .behavior("cache")
                .build())
            .cacheBehaviorSettings(DistributionCacheBehaviorSettingsArgs.builder()
                .allowedHttpMethods("GET,HEAD,OPTIONS,PUT,PATCH,POST,DELETE")
                .cachedHttpMethods("GET,HEAD")
                .defaultTtl(86400)
                .maximumTtl(31536000)
                .minimumTtl(0)
                .forwardedCookies(DistributionCacheBehaviorSettingsForwardedCookiesArgs.builder()
                    .option("none")
                    .build())
                .forwardedHeaders(DistributionCacheBehaviorSettingsForwardedHeadersArgs.builder()
                    .option("default")
                    .build())
                .forwardedQueryStrings(DistributionCacheBehaviorSettingsForwardedQueryStringsArgs.builder()
                    .option(false)
                    .build())
                .build())
            .build());

    }
}
import pulumi
import pulumi_aws as aws

test_bucket = aws.lightsail.Bucket("testBucket", bundle_id="small_1_0")
test_distribution = aws.lightsail.Distribution("testDistribution",
    bundle_id="small_1_0",
    origin=aws.lightsail.DistributionOriginArgs(
        name=test_bucket.name,
        region_name=test_bucket.region,
    ),
    default_cache_behavior=aws.lightsail.DistributionDefaultCacheBehaviorArgs(
        behavior="cache",
    ),
    cache_behavior_settings=aws.lightsail.DistributionCacheBehaviorSettingsArgs(
        allowed_http_methods="GET,HEAD,OPTIONS,PUT,PATCH,POST,DELETE",
        cached_http_methods="GET,HEAD",
        default_ttl=86400,
        maximum_ttl=31536000,
        minimum_ttl=0,
        forwarded_cookies=aws.lightsail.DistributionCacheBehaviorSettingsForwardedCookiesArgs(
            option="none",
        ),
        forwarded_headers=aws.lightsail.DistributionCacheBehaviorSettingsForwardedHeadersArgs(
            option="default",
        ),
        forwarded_query_strings=aws.lightsail.DistributionCacheBehaviorSettingsForwardedQueryStringsArgs(
            option=False,
        ),
    ))
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const testBucket = new aws.lightsail.Bucket("testBucket", {bundleId: "small_1_0"});
const testDistribution = new aws.lightsail.Distribution("testDistribution", {
    bundleId: "small_1_0",
    origin: {
        name: testBucket.name,
        regionName: testBucket.region,
    },
    defaultCacheBehavior: {
        behavior: "cache",
    },
    cacheBehaviorSettings: {
        allowedHttpMethods: "GET,HEAD,OPTIONS,PUT,PATCH,POST,DELETE",
        cachedHttpMethods: "GET,HEAD",
        defaultTtl: 86400,
        maximumTtl: 31536000,
        minimumTtl: 0,
        forwardedCookies: {
            option: "none",
        },
        forwardedHeaders: {
            option: "default",
        },
        forwardedQueryStrings: {
            option: false,
        },
    },
});
resources:
  testBucket:
    type: aws:lightsail:Bucket
    properties:
      bundleId: small_1_0
  testDistribution:
    type: aws:lightsail:Distribution
    properties:
      bundleId: small_1_0
      origin:
        name: ${testBucket.name}
        regionName: ${testBucket.region}
      defaultCacheBehavior:
        behavior: cache
      cacheBehaviorSettings:
        allowedHttpMethods: GET,HEAD,OPTIONS,PUT,PATCH,POST,DELETE
        cachedHttpMethods: GET,HEAD
        defaultTtl: 86400
        maximumTtl: 3.1536e+07
        minimumTtl: 0
        forwardedCookies:
          option: none
        forwardedHeaders:
          option: default
        forwardedQueryStrings:
          option: false

instance origin example

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var available = Aws.GetAvailabilityZones.Invoke(new()
    {
        State = "available",
        Filters = new[]
        {
            new Aws.Inputs.GetAvailabilityZonesFilterInputArgs
            {
                Name = "opt-in-status",
                Values = new[]
                {
                    "opt-in-not-required",
                },
            },
        },
    });

    var testStaticIp = new Aws.LightSail.StaticIp("testStaticIp");

    var testInstance = new Aws.LightSail.Instance("testInstance", new()
    {
        AvailabilityZone = available.Apply(getAvailabilityZonesResult => getAvailabilityZonesResult.Names[0]),
        BlueprintId = "amazon_linux_2",
        BundleId = "micro_1_0",
    });

    var testStaticIpAttachment = new Aws.LightSail.StaticIpAttachment("testStaticIpAttachment", new()
    {
        StaticIpName = testStaticIp.Name,
        InstanceName = testInstance.Name,
    });

    var testDistribution = new Aws.LightSail.Distribution("testDistribution", new()
    {
        BundleId = "small_1_0",
        Origin = new Aws.LightSail.Inputs.DistributionOriginArgs
        {
            Name = testInstance.Name,
            RegionName = available.Apply(getAvailabilityZonesResult => getAvailabilityZonesResult.Id),
        },
        DefaultCacheBehavior = new Aws.LightSail.Inputs.DistributionDefaultCacheBehaviorArgs
        {
            Behavior = "cache",
        },
    }, new CustomResourceOptions
    {
        DependsOn = new[]
        {
            testStaticIpAttachment,
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws"
	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/lightsail"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		available, err := aws.GetAvailabilityZones(ctx, &aws.GetAvailabilityZonesArgs{
			State: pulumi.StringRef("available"),
			Filters: []aws.GetAvailabilityZonesFilter{
				{
					Name: "opt-in-status",
					Values: []string{
						"opt-in-not-required",
					},
				},
			},
		}, nil)
		if err != nil {
			return err
		}
		testStaticIp, err := lightsail.NewStaticIp(ctx, "testStaticIp", nil)
		if err != nil {
			return err
		}
		testInstance, err := lightsail.NewInstance(ctx, "testInstance", &lightsail.InstanceArgs{
			AvailabilityZone: *pulumi.String(available.Names[0]),
			BlueprintId:      pulumi.String("amazon_linux_2"),
			BundleId:         pulumi.String("micro_1_0"),
		})
		if err != nil {
			return err
		}
		testStaticIpAttachment, err := lightsail.NewStaticIpAttachment(ctx, "testStaticIpAttachment", &lightsail.StaticIpAttachmentArgs{
			StaticIpName: testStaticIp.Name,
			InstanceName: testInstance.Name,
		})
		if err != nil {
			return err
		}
		_, err = lightsail.NewDistribution(ctx, "testDistribution", &lightsail.DistributionArgs{
			BundleId: pulumi.String("small_1_0"),
			Origin: &lightsail.DistributionOriginArgs{
				Name:       testInstance.Name,
				RegionName: *pulumi.String(available.Id),
			},
			DefaultCacheBehavior: &lightsail.DistributionDefaultCacheBehaviorArgs{
				Behavior: pulumi.String("cache"),
			},
		}, pulumi.DependsOn([]pulumi.Resource{
			testStaticIpAttachment,
		}))
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.AwsFunctions;
import com.pulumi.aws.inputs.GetAvailabilityZonesArgs;
import com.pulumi.aws.lightsail.StaticIp;
import com.pulumi.aws.lightsail.Instance;
import com.pulumi.aws.lightsail.InstanceArgs;
import com.pulumi.aws.lightsail.StaticIpAttachment;
import com.pulumi.aws.lightsail.StaticIpAttachmentArgs;
import com.pulumi.aws.lightsail.Distribution;
import com.pulumi.aws.lightsail.DistributionArgs;
import com.pulumi.aws.lightsail.inputs.DistributionOriginArgs;
import com.pulumi.aws.lightsail.inputs.DistributionDefaultCacheBehaviorArgs;
import com.pulumi.resources.CustomResourceOptions;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var available = AwsFunctions.getAvailabilityZones(GetAvailabilityZonesArgs.builder()
            .state("available")
            .filters(GetAvailabilityZonesFilterArgs.builder()
                .name("opt-in-status")
                .values("opt-in-not-required")
                .build())
            .build());

        var testStaticIp = new StaticIp("testStaticIp");

        var testInstance = new Instance("testInstance", InstanceArgs.builder()        
            .availabilityZone(available.applyValue(getAvailabilityZonesResult -> getAvailabilityZonesResult.names()[0]))
            .blueprintId("amazon_linux_2")
            .bundleId("micro_1_0")
            .build());

        var testStaticIpAttachment = new StaticIpAttachment("testStaticIpAttachment", StaticIpAttachmentArgs.builder()        
            .staticIpName(testStaticIp.name())
            .instanceName(testInstance.name())
            .build());

        var testDistribution = new Distribution("testDistribution", DistributionArgs.builder()        
            .bundleId("small_1_0")
            .origin(DistributionOriginArgs.builder()
                .name(testInstance.name())
                .regionName(available.applyValue(getAvailabilityZonesResult -> getAvailabilityZonesResult.id()))
                .build())
            .defaultCacheBehavior(DistributionDefaultCacheBehaviorArgs.builder()
                .behavior("cache")
                .build())
            .build(), CustomResourceOptions.builder()
                .dependsOn(testStaticIpAttachment)
                .build());

    }
}
import pulumi
import pulumi_aws as aws

available = aws.get_availability_zones(state="available",
    filters=[aws.GetAvailabilityZonesFilterArgs(
        name="opt-in-status",
        values=["opt-in-not-required"],
    )])
test_static_ip = aws.lightsail.StaticIp("testStaticIp")
test_instance = aws.lightsail.Instance("testInstance",
    availability_zone=available.names[0],
    blueprint_id="amazon_linux_2",
    bundle_id="micro_1_0")
test_static_ip_attachment = aws.lightsail.StaticIpAttachment("testStaticIpAttachment",
    static_ip_name=test_static_ip.name,
    instance_name=test_instance.name)
test_distribution = aws.lightsail.Distribution("testDistribution",
    bundle_id="small_1_0",
    origin=aws.lightsail.DistributionOriginArgs(
        name=test_instance.name,
        region_name=available.id,
    ),
    default_cache_behavior=aws.lightsail.DistributionDefaultCacheBehaviorArgs(
        behavior="cache",
    ),
    opts=pulumi.ResourceOptions(depends_on=[test_static_ip_attachment]))
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const available = aws.getAvailabilityZones({
    state: "available",
    filters: [{
        name: "opt-in-status",
        values: ["opt-in-not-required"],
    }],
});
const testStaticIp = new aws.lightsail.StaticIp("testStaticIp", {});
const testInstance = new aws.lightsail.Instance("testInstance", {
    availabilityZone: available.then(available => available.names?.[0]),
    blueprintId: "amazon_linux_2",
    bundleId: "micro_1_0",
});
const testStaticIpAttachment = new aws.lightsail.StaticIpAttachment("testStaticIpAttachment", {
    staticIpName: testStaticIp.name,
    instanceName: testInstance.name,
});
const testDistribution = new aws.lightsail.Distribution("testDistribution", {
    bundleId: "small_1_0",
    origin: {
        name: testInstance.name,
        regionName: available.then(available => available.id),
    },
    defaultCacheBehavior: {
        behavior: "cache",
    },
}, {
    dependsOn: [testStaticIpAttachment],
});
resources:
  testStaticIpAttachment:
    type: aws:lightsail:StaticIpAttachment
    properties:
      staticIpName: ${testStaticIp.name}
      instanceName: ${testInstance.name}
  testStaticIp:
    type: aws:lightsail:StaticIp
  testInstance:
    type: aws:lightsail:Instance
    properties:
      availabilityZone: ${available.names[0]}
      blueprintId: amazon_linux_2
      bundleId: micro_1_0
  testDistribution:
    type: aws:lightsail:Distribution
    properties:
      bundleId: small_1_0
      origin:
        name: ${testInstance.name}
        regionName: ${available.id}
      defaultCacheBehavior:
        behavior: cache
    options:
      dependson:
        - ${testStaticIpAttachment}
variables:
  available:
    fn::invoke:
      Function: aws:getAvailabilityZones
      Arguments:
        state: available
        filters:
          - name: opt-in-status
            values:
              - opt-in-not-required

lb origin example

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var available = Aws.GetAvailabilityZones.Invoke(new()
    {
        State = "available",
        Filters = new[]
        {
            new Aws.Inputs.GetAvailabilityZonesFilterInputArgs
            {
                Name = "opt-in-status",
                Values = new[]
                {
                    "opt-in-not-required",
                },
            },
        },
    });

    var testLb = new Aws.LightSail.Lb("testLb", new()
    {
        HealthCheckPath = "/",
        InstancePort = 80,
        Tags = 
        {
            { "foo", "bar" },
        },
    });

    var testInstance = new Aws.LightSail.Instance("testInstance", new()
    {
        AvailabilityZone = available.Apply(getAvailabilityZonesResult => getAvailabilityZonesResult.Names[0]),
        BlueprintId = "amazon_linux_2",
        BundleId = "nano_1_0",
    });

    var testLbAttachment = new Aws.LightSail.LbAttachment("testLbAttachment", new()
    {
        LbName = testLb.Name,
        InstanceName = testInstance.Name,
    });

    var testDistribution = new Aws.LightSail.Distribution("testDistribution", new()
    {
        BundleId = "small_1_0",
        Origin = new Aws.LightSail.Inputs.DistributionOriginArgs
        {
            Name = testLb.Name,
            RegionName = available.Apply(getAvailabilityZonesResult => getAvailabilityZonesResult.Id),
        },
        DefaultCacheBehavior = new Aws.LightSail.Inputs.DistributionDefaultCacheBehaviorArgs
        {
            Behavior = "cache",
        },
    }, new CustomResourceOptions
    {
        DependsOn = new[]
        {
            testLbAttachment,
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws"
	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/lightsail"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		available, err := aws.GetAvailabilityZones(ctx, &aws.GetAvailabilityZonesArgs{
			State: pulumi.StringRef("available"),
			Filters: []aws.GetAvailabilityZonesFilter{
				{
					Name: "opt-in-status",
					Values: []string{
						"opt-in-not-required",
					},
				},
			},
		}, nil)
		if err != nil {
			return err
		}
		testLb, err := lightsail.NewLb(ctx, "testLb", &lightsail.LbArgs{
			HealthCheckPath: pulumi.String("/"),
			InstancePort:    pulumi.Int(80),
			Tags: pulumi.StringMap{
				"foo": pulumi.String("bar"),
			},
		})
		if err != nil {
			return err
		}
		testInstance, err := lightsail.NewInstance(ctx, "testInstance", &lightsail.InstanceArgs{
			AvailabilityZone: *pulumi.String(available.Names[0]),
			BlueprintId:      pulumi.String("amazon_linux_2"),
			BundleId:         pulumi.String("nano_1_0"),
		})
		if err != nil {
			return err
		}
		testLbAttachment, err := lightsail.NewLbAttachment(ctx, "testLbAttachment", &lightsail.LbAttachmentArgs{
			LbName:       testLb.Name,
			InstanceName: testInstance.Name,
		})
		if err != nil {
			return err
		}
		_, err = lightsail.NewDistribution(ctx, "testDistribution", &lightsail.DistributionArgs{
			BundleId: pulumi.String("small_1_0"),
			Origin: &lightsail.DistributionOriginArgs{
				Name:       testLb.Name,
				RegionName: *pulumi.String(available.Id),
			},
			DefaultCacheBehavior: &lightsail.DistributionDefaultCacheBehaviorArgs{
				Behavior: pulumi.String("cache"),
			},
		}, pulumi.DependsOn([]pulumi.Resource{
			testLbAttachment,
		}))
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.AwsFunctions;
import com.pulumi.aws.inputs.GetAvailabilityZonesArgs;
import com.pulumi.aws.lightsail.Lb;
import com.pulumi.aws.lightsail.LbArgs;
import com.pulumi.aws.lightsail.Instance;
import com.pulumi.aws.lightsail.InstanceArgs;
import com.pulumi.aws.lightsail.LbAttachment;
import com.pulumi.aws.lightsail.LbAttachmentArgs;
import com.pulumi.aws.lightsail.Distribution;
import com.pulumi.aws.lightsail.DistributionArgs;
import com.pulumi.aws.lightsail.inputs.DistributionOriginArgs;
import com.pulumi.aws.lightsail.inputs.DistributionDefaultCacheBehaviorArgs;
import com.pulumi.resources.CustomResourceOptions;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var available = AwsFunctions.getAvailabilityZones(GetAvailabilityZonesArgs.builder()
            .state("available")
            .filters(GetAvailabilityZonesFilterArgs.builder()
                .name("opt-in-status")
                .values("opt-in-not-required")
                .build())
            .build());

        var testLb = new Lb("testLb", LbArgs.builder()        
            .healthCheckPath("/")
            .instancePort("80")
            .tags(Map.of("foo", "bar"))
            .build());

        var testInstance = new Instance("testInstance", InstanceArgs.builder()        
            .availabilityZone(available.applyValue(getAvailabilityZonesResult -> getAvailabilityZonesResult.names()[0]))
            .blueprintId("amazon_linux_2")
            .bundleId("nano_1_0")
            .build());

        var testLbAttachment = new LbAttachment("testLbAttachment", LbAttachmentArgs.builder()        
            .lbName(testLb.name())
            .instanceName(testInstance.name())
            .build());

        var testDistribution = new Distribution("testDistribution", DistributionArgs.builder()        
            .bundleId("small_1_0")
            .origin(DistributionOriginArgs.builder()
                .name(testLb.name())
                .regionName(available.applyValue(getAvailabilityZonesResult -> getAvailabilityZonesResult.id()))
                .build())
            .defaultCacheBehavior(DistributionDefaultCacheBehaviorArgs.builder()
                .behavior("cache")
                .build())
            .build(), CustomResourceOptions.builder()
                .dependsOn(testLbAttachment)
                .build());

    }
}
import pulumi
import pulumi_aws as aws

available = aws.get_availability_zones(state="available",
    filters=[aws.GetAvailabilityZonesFilterArgs(
        name="opt-in-status",
        values=["opt-in-not-required"],
    )])
test_lb = aws.lightsail.Lb("testLb",
    health_check_path="/",
    instance_port=80,
    tags={
        "foo": "bar",
    })
test_instance = aws.lightsail.Instance("testInstance",
    availability_zone=available.names[0],
    blueprint_id="amazon_linux_2",
    bundle_id="nano_1_0")
test_lb_attachment = aws.lightsail.LbAttachment("testLbAttachment",
    lb_name=test_lb.name,
    instance_name=test_instance.name)
test_distribution = aws.lightsail.Distribution("testDistribution",
    bundle_id="small_1_0",
    origin=aws.lightsail.DistributionOriginArgs(
        name=test_lb.name,
        region_name=available.id,
    ),
    default_cache_behavior=aws.lightsail.DistributionDefaultCacheBehaviorArgs(
        behavior="cache",
    ),
    opts=pulumi.ResourceOptions(depends_on=[test_lb_attachment]))
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const available = aws.getAvailabilityZones({
    state: "available",
    filters: [{
        name: "opt-in-status",
        values: ["opt-in-not-required"],
    }],
});
const testLb = new aws.lightsail.Lb("testLb", {
    healthCheckPath: "/",
    instancePort: 80,
    tags: {
        foo: "bar",
    },
});
const testInstance = new aws.lightsail.Instance("testInstance", {
    availabilityZone: available.then(available => available.names?.[0]),
    blueprintId: "amazon_linux_2",
    bundleId: "nano_1_0",
});
const testLbAttachment = new aws.lightsail.LbAttachment("testLbAttachment", {
    lbName: testLb.name,
    instanceName: testInstance.name,
});
const testDistribution = new aws.lightsail.Distribution("testDistribution", {
    bundleId: "small_1_0",
    origin: {
        name: testLb.name,
        regionName: available.then(available => available.id),
    },
    defaultCacheBehavior: {
        behavior: "cache",
    },
}, {
    dependsOn: [testLbAttachment],
});
resources:
  testLb:
    type: aws:lightsail:Lb
    properties:
      healthCheckPath: /
      instancePort: '80'
      tags:
        foo: bar
  testInstance:
    type: aws:lightsail:Instance
    properties:
      availabilityZone: ${available.names[0]}
      blueprintId: amazon_linux_2
      bundleId: nano_1_0
  testLbAttachment:
    type: aws:lightsail:LbAttachment
    properties:
      lbName: ${testLb.name}
      instanceName: ${testInstance.name}
  testDistribution:
    type: aws:lightsail:Distribution
    properties:
      bundleId: small_1_0
      origin:
        name: ${testLb.name}
        regionName: ${available.id}
      defaultCacheBehavior:
        behavior: cache
    options:
      dependson:
        - ${testLbAttachment}
variables:
  available:
    fn::invoke:
      Function: aws:getAvailabilityZones
      Arguments:
        state: available
        filters:
          - name: opt-in-status
            values:
              - opt-in-not-required

Create Distribution Resource

new Distribution(name: string, args: DistributionArgs, opts?: CustomResourceOptions);
@overload
def Distribution(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 bundle_id: Optional[str] = None,
                 cache_behavior_settings: Optional[DistributionCacheBehaviorSettingsArgs] = None,
                 cache_behaviors: Optional[Sequence[DistributionCacheBehaviorArgs]] = None,
                 certificate_name: Optional[str] = None,
                 default_cache_behavior: Optional[DistributionDefaultCacheBehaviorArgs] = None,
                 ip_address_type: Optional[str] = None,
                 is_enabled: Optional[bool] = None,
                 name: Optional[str] = None,
                 origin: Optional[DistributionOriginArgs] = None,
                 tags: Optional[Mapping[str, str]] = None)
@overload
def Distribution(resource_name: str,
                 args: DistributionArgs,
                 opts: Optional[ResourceOptions] = None)
func NewDistribution(ctx *Context, name string, args DistributionArgs, opts ...ResourceOption) (*Distribution, error)
public Distribution(string name, DistributionArgs args, CustomResourceOptions? opts = null)
public Distribution(String name, DistributionArgs args)
public Distribution(String name, DistributionArgs args, CustomResourceOptions options)
type: aws:lightsail:Distribution
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args DistributionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args DistributionArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args DistributionArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args DistributionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args DistributionArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Distribution Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The Distribution resource accepts the following input properties:

BundleId string

Bundle ID to use for the distribution.

DefaultCacheBehavior Pulumi.Aws.LightSail.Inputs.DistributionDefaultCacheBehaviorArgs

Object that describes the default cache behavior of the distribution. Detailed below

Origin Pulumi.Aws.LightSail.Inputs.DistributionOriginArgs

Object that describes the origin resource of the distribution, such as a Lightsail instance, bucket, or load balancer. Detailed below

CacheBehaviorSettings Pulumi.Aws.LightSail.Inputs.DistributionCacheBehaviorSettingsArgs

An object that describes the cache behavior settings of the distribution. Detailed below

CacheBehaviors List<Pulumi.Aws.LightSail.Inputs.DistributionCacheBehaviorArgs>

A set of configuration blocks that describe the per-path cache behavior of the distribution. Detailed below

CertificateName string

The name of the SSL/TLS certificate attached to the distribution, if any.

IpAddressType string

The IP address type of the distribution. Default: dualstack.

IsEnabled bool

Indicates whether the distribution is enabled. Default: true.

Name string

Name of the distribution.

Tags Dictionary<string, string>

Map of tags for the Lightsail Distribution. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

BundleId string

Bundle ID to use for the distribution.

DefaultCacheBehavior DistributionDefaultCacheBehaviorArgs

Object that describes the default cache behavior of the distribution. Detailed below

Origin DistributionOriginArgs

Object that describes the origin resource of the distribution, such as a Lightsail instance, bucket, or load balancer. Detailed below

CacheBehaviorSettings DistributionCacheBehaviorSettingsArgs

An object that describes the cache behavior settings of the distribution. Detailed below

CacheBehaviors []DistributionCacheBehaviorArgs

A set of configuration blocks that describe the per-path cache behavior of the distribution. Detailed below

CertificateName string

The name of the SSL/TLS certificate attached to the distribution, if any.

IpAddressType string

The IP address type of the distribution. Default: dualstack.

IsEnabled bool

Indicates whether the distribution is enabled. Default: true.

Name string

Name of the distribution.

Tags map[string]string

Map of tags for the Lightsail Distribution. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

bundleId String

Bundle ID to use for the distribution.

defaultCacheBehavior DistributionDefaultCacheBehaviorArgs

Object that describes the default cache behavior of the distribution. Detailed below

origin DistributionOriginArgs

Object that describes the origin resource of the distribution, such as a Lightsail instance, bucket, or load balancer. Detailed below

cacheBehaviorSettings DistributionCacheBehaviorSettingsArgs

An object that describes the cache behavior settings of the distribution. Detailed below

cacheBehaviors List<DistributionCacheBehaviorArgs>

A set of configuration blocks that describe the per-path cache behavior of the distribution. Detailed below

certificateName String

The name of the SSL/TLS certificate attached to the distribution, if any.

ipAddressType String

The IP address type of the distribution. Default: dualstack.

isEnabled Boolean

Indicates whether the distribution is enabled. Default: true.

name String

Name of the distribution.

tags Map<String,String>

Map of tags for the Lightsail Distribution. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

bundleId string

Bundle ID to use for the distribution.

defaultCacheBehavior DistributionDefaultCacheBehaviorArgs

Object that describes the default cache behavior of the distribution. Detailed below

origin DistributionOriginArgs

Object that describes the origin resource of the distribution, such as a Lightsail instance, bucket, or load balancer. Detailed below

cacheBehaviorSettings DistributionCacheBehaviorSettingsArgs

An object that describes the cache behavior settings of the distribution. Detailed below

cacheBehaviors DistributionCacheBehaviorArgs[]

A set of configuration blocks that describe the per-path cache behavior of the distribution. Detailed below

certificateName string

The name of the SSL/TLS certificate attached to the distribution, if any.

ipAddressType string

The IP address type of the distribution. Default: dualstack.

isEnabled boolean

Indicates whether the distribution is enabled. Default: true.

name string

Name of the distribution.

tags {[key: string]: string}

Map of tags for the Lightsail Distribution. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

bundle_id str

Bundle ID to use for the distribution.

default_cache_behavior DistributionDefaultCacheBehaviorArgs

Object that describes the default cache behavior of the distribution. Detailed below

origin DistributionOriginArgs

Object that describes the origin resource of the distribution, such as a Lightsail instance, bucket, or load balancer. Detailed below

cache_behavior_settings DistributionCacheBehaviorSettingsArgs

An object that describes the cache behavior settings of the distribution. Detailed below

cache_behaviors Sequence[DistributionCacheBehaviorArgs]

A set of configuration blocks that describe the per-path cache behavior of the distribution. Detailed below

certificate_name str

The name of the SSL/TLS certificate attached to the distribution, if any.

ip_address_type str

The IP address type of the distribution. Default: dualstack.

is_enabled bool

Indicates whether the distribution is enabled. Default: true.

name str

Name of the distribution.

tags Mapping[str, str]

Map of tags for the Lightsail Distribution. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

bundleId String

Bundle ID to use for the distribution.

defaultCacheBehavior Property Map

Object that describes the default cache behavior of the distribution. Detailed below

origin Property Map

Object that describes the origin resource of the distribution, such as a Lightsail instance, bucket, or load balancer. Detailed below

cacheBehaviorSettings Property Map

An object that describes the cache behavior settings of the distribution. Detailed below

cacheBehaviors List<Property Map>

A set of configuration blocks that describe the per-path cache behavior of the distribution. Detailed below

certificateName String

The name of the SSL/TLS certificate attached to the distribution, if any.

ipAddressType String

The IP address type of the distribution. Default: dualstack.

isEnabled Boolean

Indicates whether the distribution is enabled. Default: true.

name String

Name of the distribution.

tags Map<String>

Map of tags for the Lightsail Distribution. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Outputs

All input properties are implicitly available as output properties. Additionally, the Distribution resource produces the following output properties:

AlternativeDomainNames List<string>

The alternate domain names of the distribution.

Arn string

The Amazon Resource Name (ARN) of the distribution.

CreatedAt string

The timestamp when the distribution was created.

DomainName string

The domain name of the distribution.

Id string

The provider-assigned unique ID for this managed resource.

Locations List<Pulumi.Aws.LightSail.Outputs.DistributionLocation>

An object that describes the location of the distribution, such as the AWS Region and Availability Zone. Detailed below

OriginPublicDns string

The public DNS of the origin.

ResourceType string

The resource type of the origin resource (e.g., Instance).

Status string

The status of the distribution.

SupportCode string

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.

TagsAll Dictionary<string, string>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

AlternativeDomainNames []string

The alternate domain names of the distribution.

Arn string

The Amazon Resource Name (ARN) of the distribution.

CreatedAt string

The timestamp when the distribution was created.

DomainName string

The domain name of the distribution.

Id string

The provider-assigned unique ID for this managed resource.

Locations []DistributionLocation

An object that describes the location of the distribution, such as the AWS Region and Availability Zone. Detailed below

OriginPublicDns string

The public DNS of the origin.

ResourceType string

The resource type of the origin resource (e.g., Instance).

Status string

The status of the distribution.

SupportCode string

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.

TagsAll map[string]string

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

alternativeDomainNames List<String>

The alternate domain names of the distribution.

arn String

The Amazon Resource Name (ARN) of the distribution.

createdAt String

The timestamp when the distribution was created.

domainName String

The domain name of the distribution.

id String

The provider-assigned unique ID for this managed resource.

locations List<DistributionLocation>

An object that describes the location of the distribution, such as the AWS Region and Availability Zone. Detailed below

originPublicDns String

The public DNS of the origin.

resourceType String

The resource type of the origin resource (e.g., Instance).

status String

The status of the distribution.

supportCode String

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.

tagsAll Map<String,String>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

alternativeDomainNames string[]

The alternate domain names of the distribution.

arn string

The Amazon Resource Name (ARN) of the distribution.

createdAt string

The timestamp when the distribution was created.

domainName string

The domain name of the distribution.

id string

The provider-assigned unique ID for this managed resource.

locations DistributionLocation[]

An object that describes the location of the distribution, such as the AWS Region and Availability Zone. Detailed below

originPublicDns string

The public DNS of the origin.

resourceType string

The resource type of the origin resource (e.g., Instance).

status string

The status of the distribution.

supportCode string

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.

tagsAll {[key: string]: string}

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

alternative_domain_names Sequence[str]

The alternate domain names of the distribution.

arn str

The Amazon Resource Name (ARN) of the distribution.

created_at str

The timestamp when the distribution was created.

domain_name str

The domain name of the distribution.

id str

The provider-assigned unique ID for this managed resource.

locations Sequence[DistributionLocation]

An object that describes the location of the distribution, such as the AWS Region and Availability Zone. Detailed below

origin_public_dns str

The public DNS of the origin.

resource_type str

The resource type of the origin resource (e.g., Instance).

status str

The status of the distribution.

support_code str

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.

tags_all Mapping[str, str]

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

alternativeDomainNames List<String>

The alternate domain names of the distribution.

arn String

The Amazon Resource Name (ARN) of the distribution.

createdAt String

The timestamp when the distribution was created.

domainName String

The domain name of the distribution.

id String

The provider-assigned unique ID for this managed resource.

locations List<Property Map>

An object that describes the location of the distribution, such as the AWS Region and Availability Zone. Detailed below

originPublicDns String

The public DNS of the origin.

resourceType String

The resource type of the origin resource (e.g., Instance).

status String

The status of the distribution.

supportCode String

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.

tagsAll Map<String>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Look up Existing Distribution Resource

Get an existing Distribution resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: DistributionState, opts?: CustomResourceOptions): Distribution
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        alternative_domain_names: Optional[Sequence[str]] = None,
        arn: Optional[str] = None,
        bundle_id: Optional[str] = None,
        cache_behavior_settings: Optional[DistributionCacheBehaviorSettingsArgs] = None,
        cache_behaviors: Optional[Sequence[DistributionCacheBehaviorArgs]] = None,
        certificate_name: Optional[str] = None,
        created_at: Optional[str] = None,
        default_cache_behavior: Optional[DistributionDefaultCacheBehaviorArgs] = None,
        domain_name: Optional[str] = None,
        ip_address_type: Optional[str] = None,
        is_enabled: Optional[bool] = None,
        locations: Optional[Sequence[DistributionLocationArgs]] = None,
        name: Optional[str] = None,
        origin: Optional[DistributionOriginArgs] = None,
        origin_public_dns: Optional[str] = None,
        resource_type: Optional[str] = None,
        status: Optional[str] = None,
        support_code: Optional[str] = None,
        tags: Optional[Mapping[str, str]] = None,
        tags_all: Optional[Mapping[str, str]] = None) -> Distribution
func GetDistribution(ctx *Context, name string, id IDInput, state *DistributionState, opts ...ResourceOption) (*Distribution, error)
public static Distribution Get(string name, Input<string> id, DistributionState? state, CustomResourceOptions? opts = null)
public static Distribution get(String name, Output<String> id, DistributionState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
AlternativeDomainNames List<string>

The alternate domain names of the distribution.

Arn string

The Amazon Resource Name (ARN) of the distribution.

BundleId string

Bundle ID to use for the distribution.

CacheBehaviorSettings Pulumi.Aws.LightSail.Inputs.DistributionCacheBehaviorSettingsArgs

An object that describes the cache behavior settings of the distribution. Detailed below

CacheBehaviors List<Pulumi.Aws.LightSail.Inputs.DistributionCacheBehaviorArgs>

A set of configuration blocks that describe the per-path cache behavior of the distribution. Detailed below

CertificateName string

The name of the SSL/TLS certificate attached to the distribution, if any.

CreatedAt string

The timestamp when the distribution was created.

DefaultCacheBehavior Pulumi.Aws.LightSail.Inputs.DistributionDefaultCacheBehaviorArgs

Object that describes the default cache behavior of the distribution. Detailed below

DomainName string

The domain name of the distribution.

IpAddressType string

The IP address type of the distribution. Default: dualstack.

IsEnabled bool

Indicates whether the distribution is enabled. Default: true.

Locations List<Pulumi.Aws.LightSail.Inputs.DistributionLocationArgs>

An object that describes the location of the distribution, such as the AWS Region and Availability Zone. Detailed below

Name string

Name of the distribution.

Origin Pulumi.Aws.LightSail.Inputs.DistributionOriginArgs

Object that describes the origin resource of the distribution, such as a Lightsail instance, bucket, or load balancer. Detailed below

OriginPublicDns string

The public DNS of the origin.

ResourceType string

The resource type of the origin resource (e.g., Instance).

Status string

The status of the distribution.

SupportCode string

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.

Tags Dictionary<string, string>

Map of tags for the Lightsail Distribution. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

TagsAll Dictionary<string, string>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

AlternativeDomainNames []string

The alternate domain names of the distribution.

Arn string

The Amazon Resource Name (ARN) of the distribution.

BundleId string

Bundle ID to use for the distribution.

CacheBehaviorSettings DistributionCacheBehaviorSettingsArgs

An object that describes the cache behavior settings of the distribution. Detailed below

CacheBehaviors []DistributionCacheBehaviorArgs

A set of configuration blocks that describe the per-path cache behavior of the distribution. Detailed below

CertificateName string

The name of the SSL/TLS certificate attached to the distribution, if any.

CreatedAt string

The timestamp when the distribution was created.

DefaultCacheBehavior DistributionDefaultCacheBehaviorArgs

Object that describes the default cache behavior of the distribution. Detailed below

DomainName string

The domain name of the distribution.

IpAddressType string

The IP address type of the distribution. Default: dualstack.

IsEnabled bool

Indicates whether the distribution is enabled. Default: true.

Locations []DistributionLocationArgs

An object that describes the location of the distribution, such as the AWS Region and Availability Zone. Detailed below

Name string

Name of the distribution.

Origin DistributionOriginArgs

Object that describes the origin resource of the distribution, such as a Lightsail instance, bucket, or load balancer. Detailed below

OriginPublicDns string

The public DNS of the origin.

ResourceType string

The resource type of the origin resource (e.g., Instance).

Status string

The status of the distribution.

SupportCode string

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.

Tags map[string]string

Map of tags for the Lightsail Distribution. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

TagsAll map[string]string

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

alternativeDomainNames List<String>

The alternate domain names of the distribution.

arn String

The Amazon Resource Name (ARN) of the distribution.

bundleId String

Bundle ID to use for the distribution.

cacheBehaviorSettings DistributionCacheBehaviorSettingsArgs

An object that describes the cache behavior settings of the distribution. Detailed below

cacheBehaviors List<DistributionCacheBehaviorArgs>

A set of configuration blocks that describe the per-path cache behavior of the distribution. Detailed below

certificateName String

The name of the SSL/TLS certificate attached to the distribution, if any.

createdAt String

The timestamp when the distribution was created.

defaultCacheBehavior DistributionDefaultCacheBehaviorArgs

Object that describes the default cache behavior of the distribution. Detailed below

domainName String

The domain name of the distribution.

ipAddressType String

The IP address type of the distribution. Default: dualstack.

isEnabled Boolean

Indicates whether the distribution is enabled. Default: true.

locations List<DistributionLocationArgs>

An object that describes the location of the distribution, such as the AWS Region and Availability Zone. Detailed below

name String

Name of the distribution.

origin DistributionOriginArgs

Object that describes the origin resource of the distribution, such as a Lightsail instance, bucket, or load balancer. Detailed below

originPublicDns String

The public DNS of the origin.

resourceType String

The resource type of the origin resource (e.g., Instance).

status String

The status of the distribution.

supportCode String

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.

tags Map<String,String>

Map of tags for the Lightsail Distribution. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

tagsAll Map<String,String>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

alternativeDomainNames string[]

The alternate domain names of the distribution.

arn string

The Amazon Resource Name (ARN) of the distribution.

bundleId string

Bundle ID to use for the distribution.

cacheBehaviorSettings DistributionCacheBehaviorSettingsArgs

An object that describes the cache behavior settings of the distribution. Detailed below

cacheBehaviors DistributionCacheBehaviorArgs[]

A set of configuration blocks that describe the per-path cache behavior of the distribution. Detailed below

certificateName string

The name of the SSL/TLS certificate attached to the distribution, if any.

createdAt string

The timestamp when the distribution was created.

defaultCacheBehavior DistributionDefaultCacheBehaviorArgs

Object that describes the default cache behavior of the distribution. Detailed below

domainName string

The domain name of the distribution.

ipAddressType string

The IP address type of the distribution. Default: dualstack.

isEnabled boolean

Indicates whether the distribution is enabled. Default: true.

locations DistributionLocationArgs[]

An object that describes the location of the distribution, such as the AWS Region and Availability Zone. Detailed below

name string

Name of the distribution.

origin DistributionOriginArgs

Object that describes the origin resource of the distribution, such as a Lightsail instance, bucket, or load balancer. Detailed below

originPublicDns string

The public DNS of the origin.

resourceType string

The resource type of the origin resource (e.g., Instance).

status string

The status of the distribution.

supportCode string

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.

tags {[key: string]: string}

Map of tags for the Lightsail Distribution. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

tagsAll {[key: string]: string}

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

alternative_domain_names Sequence[str]

The alternate domain names of the distribution.

arn str

The Amazon Resource Name (ARN) of the distribution.

bundle_id str

Bundle ID to use for the distribution.

cache_behavior_settings DistributionCacheBehaviorSettingsArgs

An object that describes the cache behavior settings of the distribution. Detailed below

cache_behaviors Sequence[DistributionCacheBehaviorArgs]

A set of configuration blocks that describe the per-path cache behavior of the distribution. Detailed below

certificate_name str

The name of the SSL/TLS certificate attached to the distribution, if any.

created_at str

The timestamp when the distribution was created.

default_cache_behavior DistributionDefaultCacheBehaviorArgs

Object that describes the default cache behavior of the distribution. Detailed below

domain_name str

The domain name of the distribution.

ip_address_type str

The IP address type of the distribution. Default: dualstack.

is_enabled bool

Indicates whether the distribution is enabled. Default: true.

locations Sequence[DistributionLocationArgs]

An object that describes the location of the distribution, such as the AWS Region and Availability Zone. Detailed below

name str

Name of the distribution.

origin DistributionOriginArgs

Object that describes the origin resource of the distribution, such as a Lightsail instance, bucket, or load balancer. Detailed below

origin_public_dns str

The public DNS of the origin.

resource_type str

The resource type of the origin resource (e.g., Instance).

status str

The status of the distribution.

support_code str

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.

tags Mapping[str, str]

Map of tags for the Lightsail Distribution. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

tags_all Mapping[str, str]

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

alternativeDomainNames List<String>

The alternate domain names of the distribution.

arn String

The Amazon Resource Name (ARN) of the distribution.

bundleId String

Bundle ID to use for the distribution.

cacheBehaviorSettings Property Map

An object that describes the cache behavior settings of the distribution. Detailed below

cacheBehaviors List<Property Map>

A set of configuration blocks that describe the per-path cache behavior of the distribution. Detailed below

certificateName String

The name of the SSL/TLS certificate attached to the distribution, if any.

createdAt String

The timestamp when the distribution was created.

defaultCacheBehavior Property Map

Object that describes the default cache behavior of the distribution. Detailed below

domainName String

The domain name of the distribution.

ipAddressType String

The IP address type of the distribution. Default: dualstack.

isEnabled Boolean

Indicates whether the distribution is enabled. Default: true.

locations List<Property Map>

An object that describes the location of the distribution, such as the AWS Region and Availability Zone. Detailed below

name String

Name of the distribution.

origin Property Map

Object that describes the origin resource of the distribution, such as a Lightsail instance, bucket, or load balancer. Detailed below

originPublicDns String

The public DNS of the origin.

resourceType String

The resource type of the origin resource (e.g., Instance).

status String

The status of the distribution.

supportCode String

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.

tags Map<String>

Map of tags for the Lightsail Distribution. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

tagsAll Map<String>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Supporting Types

DistributionCacheBehavior

Behavior string

The cache behavior for the specified path.

Path string

The path to a directory or file to cached, or not cache. Use an asterisk symbol to specify wildcard directories (path/to/assets/*), and file types (*.html, *jpg, *js). Directories and file paths are case-sensitive.

Behavior string

The cache behavior for the specified path.

Path string

The path to a directory or file to cached, or not cache. Use an asterisk symbol to specify wildcard directories (path/to/assets/*), and file types (*.html, *jpg, *js). Directories and file paths are case-sensitive.

behavior String

The cache behavior for the specified path.

path String

The path to a directory or file to cached, or not cache. Use an asterisk symbol to specify wildcard directories (path/to/assets/*), and file types (*.html, *jpg, *js). Directories and file paths are case-sensitive.

behavior string

The cache behavior for the specified path.

path string

The path to a directory or file to cached, or not cache. Use an asterisk symbol to specify wildcard directories (path/to/assets/*), and file types (*.html, *jpg, *js). Directories and file paths are case-sensitive.

behavior str

The cache behavior for the specified path.

path str

The path to a directory or file to cached, or not cache. Use an asterisk symbol to specify wildcard directories (path/to/assets/*), and file types (*.html, *jpg, *js). Directories and file paths are case-sensitive.

behavior String

The cache behavior for the specified path.

path String

The path to a directory or file to cached, or not cache. Use an asterisk symbol to specify wildcard directories (path/to/assets/*), and file types (*.html, *jpg, *js). Directories and file paths are case-sensitive.

DistributionCacheBehaviorSettings

AllowedHttpMethods string

The HTTP methods that are processed and forwarded to the distribution's origin.

CachedHttpMethods string

The HTTP method responses that are cached by your distribution.

DefaultTtl int

The default amount of time that objects stay in the distribution's cache before the distribution forwards another request to the origin to determine whether the content has been updated.

ForwardedCookies Pulumi.Aws.LightSail.Inputs.DistributionCacheBehaviorSettingsForwardedCookies

An object that describes the cookies that are forwarded to the origin. Your content is cached based on the cookies that are forwarded. Detailed below

ForwardedHeaders Pulumi.Aws.LightSail.Inputs.DistributionCacheBehaviorSettingsForwardedHeaders

An object that describes the headers that are forwarded to the origin. Your content is cached based on the headers that are forwarded. Detailed below

ForwardedQueryStrings Pulumi.Aws.LightSail.Inputs.DistributionCacheBehaviorSettingsForwardedQueryStrings

An object that describes the query strings that are forwarded to the origin. Your content is cached based on the query strings that are forwarded. Detailed below

MaximumTtl int

The maximum amount of time that objects stay in the distribution's cache before the distribution forwards another request to the origin to determine whether the object has been updated.

MinimumTtl int

The minimum amount of time that objects stay in the distribution's cache before the distribution forwards another request to the origin to determine whether the object has been updated.

AllowedHttpMethods string

The HTTP methods that are processed and forwarded to the distribution's origin.

CachedHttpMethods string

The HTTP method responses that are cached by your distribution.

DefaultTtl int

The default amount of time that objects stay in the distribution's cache before the distribution forwards another request to the origin to determine whether the content has been updated.

ForwardedCookies DistributionCacheBehaviorSettingsForwardedCookies

An object that describes the cookies that are forwarded to the origin. Your content is cached based on the cookies that are forwarded. Detailed below

ForwardedHeaders DistributionCacheBehaviorSettingsForwardedHeaders

An object that describes the headers that are forwarded to the origin. Your content is cached based on the headers that are forwarded. Detailed below

ForwardedQueryStrings DistributionCacheBehaviorSettingsForwardedQueryStrings

An object that describes the query strings that are forwarded to the origin. Your content is cached based on the query strings that are forwarded. Detailed below

MaximumTtl int

The maximum amount of time that objects stay in the distribution's cache before the distribution forwards another request to the origin to determine whether the object has been updated.

MinimumTtl int

The minimum amount of time that objects stay in the distribution's cache before the distribution forwards another request to the origin to determine whether the object has been updated.

allowedHttpMethods String

The HTTP methods that are processed and forwarded to the distribution's origin.

cachedHttpMethods String

The HTTP method responses that are cached by your distribution.

defaultTtl Integer

The default amount of time that objects stay in the distribution's cache before the distribution forwards another request to the origin to determine whether the content has been updated.

forwardedCookies DistributionCacheBehaviorSettingsForwardedCookies

An object that describes the cookies that are forwarded to the origin. Your content is cached based on the cookies that are forwarded. Detailed below

forwardedHeaders DistributionCacheBehaviorSettingsForwardedHeaders

An object that describes the headers that are forwarded to the origin. Your content is cached based on the headers that are forwarded. Detailed below

forwardedQueryStrings DistributionCacheBehaviorSettingsForwardedQueryStrings

An object that describes the query strings that are forwarded to the origin. Your content is cached based on the query strings that are forwarded. Detailed below

maximumTtl Integer

The maximum amount of time that objects stay in the distribution's cache before the distribution forwards another request to the origin to determine whether the object has been updated.

minimumTtl Integer

The minimum amount of time that objects stay in the distribution's cache before the distribution forwards another request to the origin to determine whether the object has been updated.

allowedHttpMethods string

The HTTP methods that are processed and forwarded to the distribution's origin.

cachedHttpMethods string

The HTTP method responses that are cached by your distribution.

defaultTtl number

The default amount of time that objects stay in the distribution's cache before the distribution forwards another request to the origin to determine whether the content has been updated.

forwardedCookies DistributionCacheBehaviorSettingsForwardedCookies

An object that describes the cookies that are forwarded to the origin. Your content is cached based on the cookies that are forwarded. Detailed below

forwardedHeaders DistributionCacheBehaviorSettingsForwardedHeaders

An object that describes the headers that are forwarded to the origin. Your content is cached based on the headers that are forwarded. Detailed below

forwardedQueryStrings DistributionCacheBehaviorSettingsForwardedQueryStrings

An object that describes the query strings that are forwarded to the origin. Your content is cached based on the query strings that are forwarded. Detailed below

maximumTtl number

The maximum amount of time that objects stay in the distribution's cache before the distribution forwards another request to the origin to determine whether the object has been updated.

minimumTtl number

The minimum amount of time that objects stay in the distribution's cache before the distribution forwards another request to the origin to determine whether the object has been updated.

allowed_http_methods str

The HTTP methods that are processed and forwarded to the distribution's origin.

cached_http_methods str

The HTTP method responses that are cached by your distribution.

default_ttl int

The default amount of time that objects stay in the distribution's cache before the distribution forwards another request to the origin to determine whether the content has been updated.

forwarded_cookies DistributionCacheBehaviorSettingsForwardedCookies

An object that describes the cookies that are forwarded to the origin. Your content is cached based on the cookies that are forwarded. Detailed below

forwarded_headers DistributionCacheBehaviorSettingsForwardedHeaders

An object that describes the headers that are forwarded to the origin. Your content is cached based on the headers that are forwarded. Detailed below

forwarded_query_strings DistributionCacheBehaviorSettingsForwardedQueryStrings

An object that describes the query strings that are forwarded to the origin. Your content is cached based on the query strings that are forwarded. Detailed below

maximum_ttl int

The maximum amount of time that objects stay in the distribution's cache before the distribution forwards another request to the origin to determine whether the object has been updated.

minimum_ttl int

The minimum amount of time that objects stay in the distribution's cache before the distribution forwards another request to the origin to determine whether the object has been updated.

allowedHttpMethods String

The HTTP methods that are processed and forwarded to the distribution's origin.

cachedHttpMethods String

The HTTP method responses that are cached by your distribution.

defaultTtl Number

The default amount of time that objects stay in the distribution's cache before the distribution forwards another request to the origin to determine whether the content has been updated.

forwardedCookies Property Map

An object that describes the cookies that are forwarded to the origin. Your content is cached based on the cookies that are forwarded. Detailed below

forwardedHeaders Property Map

An object that describes the headers that are forwarded to the origin. Your content is cached based on the headers that are forwarded. Detailed below

forwardedQueryStrings Property Map

An object that describes the query strings that are forwarded to the origin. Your content is cached based on the query strings that are forwarded. Detailed below

maximumTtl Number

The maximum amount of time that objects stay in the distribution's cache before the distribution forwards another request to the origin to determine whether the object has been updated.

minimumTtl Number

The minimum amount of time that objects stay in the distribution's cache before the distribution forwards another request to the origin to determine whether the object has been updated.

DistributionCacheBehaviorSettingsForwardedCookies

CookiesAllowLists List<string>

The specific cookies to forward to your distribution's origin.

Option string

Specifies which cookies to forward to the distribution's origin for a cache behavior: all, none, or allow-list to forward only the cookies specified in the cookiesAllowList parameter.

CookiesAllowLists []string

The specific cookies to forward to your distribution's origin.

Option string

Specifies which cookies to forward to the distribution's origin for a cache behavior: all, none, or allow-list to forward only the cookies specified in the cookiesAllowList parameter.

cookiesAllowLists List<String>

The specific cookies to forward to your distribution's origin.

option String

Specifies which cookies to forward to the distribution's origin for a cache behavior: all, none, or allow-list to forward only the cookies specified in the cookiesAllowList parameter.

cookiesAllowLists string[]

The specific cookies to forward to your distribution's origin.

option string

Specifies which cookies to forward to the distribution's origin for a cache behavior: all, none, or allow-list to forward only the cookies specified in the cookiesAllowList parameter.

cookies_allow_lists Sequence[str]

The specific cookies to forward to your distribution's origin.

option str

Specifies which cookies to forward to the distribution's origin for a cache behavior: all, none, or allow-list to forward only the cookies specified in the cookiesAllowList parameter.

cookiesAllowLists List<String>

The specific cookies to forward to your distribution's origin.

option String

Specifies which cookies to forward to the distribution's origin for a cache behavior: all, none, or allow-list to forward only the cookies specified in the cookiesAllowList parameter.

DistributionCacheBehaviorSettingsForwardedHeaders

HeadersAllowLists List<string>

The specific headers to forward to your distribution's origin.

Option string

The headers that you want your distribution to forward to your origin and base caching on.

HeadersAllowLists []string

The specific headers to forward to your distribution's origin.

Option string

The headers that you want your distribution to forward to your origin and base caching on.

headersAllowLists List<String>

The specific headers to forward to your distribution's origin.

option String

The headers that you want your distribution to forward to your origin and base caching on.

headersAllowLists string[]

The specific headers to forward to your distribution's origin.

option string

The headers that you want your distribution to forward to your origin and base caching on.

headers_allow_lists Sequence[str]

The specific headers to forward to your distribution's origin.

option str

The headers that you want your distribution to forward to your origin and base caching on.

headersAllowLists List<String>

The specific headers to forward to your distribution's origin.

option String

The headers that you want your distribution to forward to your origin and base caching on.

DistributionCacheBehaviorSettingsForwardedQueryStrings

Option bool

Indicates whether the distribution forwards and caches based on query strings.

QueryStringsAllowedLists List<string>

The specific query strings that the distribution forwards to the origin.

Option bool

Indicates whether the distribution forwards and caches based on query strings.

QueryStringsAllowedLists []string

The specific query strings that the distribution forwards to the origin.

option Boolean

Indicates whether the distribution forwards and caches based on query strings.

queryStringsAllowedLists List<String>

The specific query strings that the distribution forwards to the origin.

option boolean

Indicates whether the distribution forwards and caches based on query strings.

queryStringsAllowedLists string[]

The specific query strings that the distribution forwards to the origin.

option bool

Indicates whether the distribution forwards and caches based on query strings.

query_strings_allowed_lists Sequence[str]

The specific query strings that the distribution forwards to the origin.

option Boolean

Indicates whether the distribution forwards and caches based on query strings.

queryStringsAllowedLists List<String>

The specific query strings that the distribution forwards to the origin.

DistributionDefaultCacheBehavior

Behavior string

The cache behavior of the distribution. Valid values: cache and dont-cache.

Behavior string

The cache behavior of the distribution. Valid values: cache and dont-cache.

behavior String

The cache behavior of the distribution. Valid values: cache and dont-cache.

behavior string

The cache behavior of the distribution. Valid values: cache and dont-cache.

behavior str

The cache behavior of the distribution. Valid values: cache and dont-cache.

behavior String

The cache behavior of the distribution. Valid values: cache and dont-cache.

DistributionLocation

AvailabilityZone string

The Availability Zone. Follows the format us-east-2a (case-sensitive).

RegionName string

The AWS Region name of the origin resource.

AvailabilityZone string

The Availability Zone. Follows the format us-east-2a (case-sensitive).

RegionName string

The AWS Region name of the origin resource.

availabilityZone String

The Availability Zone. Follows the format us-east-2a (case-sensitive).

regionName String

The AWS Region name of the origin resource.

availabilityZone string

The Availability Zone. Follows the format us-east-2a (case-sensitive).

regionName string

The AWS Region name of the origin resource.

availability_zone str

The Availability Zone. Follows the format us-east-2a (case-sensitive).

region_name str

The AWS Region name of the origin resource.

availabilityZone String

The Availability Zone. Follows the format us-east-2a (case-sensitive).

regionName String

The AWS Region name of the origin resource.

DistributionOrigin

Name string

The name of the origin resource. Your origin can be an instance with an attached static IP, a bucket, or a load balancer that has at least one instance attached to it.

RegionName string

The AWS Region name of the origin resource.

ProtocolPolicy string

The protocol that your Amazon Lightsail distribution uses when establishing a connection with your origin to pull content.

ResourceType string

The resource type of the origin resource (e.g., Instance).

Name string

The name of the origin resource. Your origin can be an instance with an attached static IP, a bucket, or a load balancer that has at least one instance attached to it.

RegionName string

The AWS Region name of the origin resource.

ProtocolPolicy string

The protocol that your Amazon Lightsail distribution uses when establishing a connection with your origin to pull content.

ResourceType string

The resource type of the origin resource (e.g., Instance).

name String

The name of the origin resource. Your origin can be an instance with an attached static IP, a bucket, or a load balancer that has at least one instance attached to it.

regionName String

The AWS Region name of the origin resource.

protocolPolicy String

The protocol that your Amazon Lightsail distribution uses when establishing a connection with your origin to pull content.

resourceType String

The resource type of the origin resource (e.g., Instance).

name string

The name of the origin resource. Your origin can be an instance with an attached static IP, a bucket, or a load balancer that has at least one instance attached to it.

regionName string

The AWS Region name of the origin resource.

protocolPolicy string

The protocol that your Amazon Lightsail distribution uses when establishing a connection with your origin to pull content.

resourceType string

The resource type of the origin resource (e.g., Instance).

name str

The name of the origin resource. Your origin can be an instance with an attached static IP, a bucket, or a load balancer that has at least one instance attached to it.

region_name str

The AWS Region name of the origin resource.

protocol_policy str

The protocol that your Amazon Lightsail distribution uses when establishing a connection with your origin to pull content.

resource_type str

The resource type of the origin resource (e.g., Instance).

name String

The name of the origin resource. Your origin can be an instance with an attached static IP, a bucket, or a load balancer that has at least one instance attached to it.

regionName String

The AWS Region name of the origin resource.

protocolPolicy String

The protocol that your Amazon Lightsail distribution uses when establishing a connection with your origin to pull content.

resourceType String

The resource type of the origin resource (e.g., Instance).

Import

Lightsail Distribution can be imported using the id, e.g.,

 $ pulumi import aws:lightsail/distribution:Distribution example rft-8012925589

Package Details

Repository
AWS Classic pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.