aws.cloudfront.VpcOrigin
Explore with Pulumi AI
Creates an Amazon CloudFront VPC origin.
For information about CloudFront VPC origins, see [Amazon CloudFront Developer Guide - Restrict access with VPC origins][1].
Example Usage
Application Load Balancer
The following example below creates a CloudFront VPC origin for a Application Load Balancer.
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const alb = new aws.cloudfront.VpcOrigin("alb", {vpcOriginEndpointConfig: {
    name: "example-vpc-origin",
    arn: _this.arn,
    httpPort: 8080,
    httpsPort: 8443,
    originProtocolPolicy: "https-only",
    originSslProtocols: {
        items: ["TLSv1.2"],
        quantity: 1,
    },
}});
import pulumi
import pulumi_aws as aws
alb = aws.cloudfront.VpcOrigin("alb", vpc_origin_endpoint_config={
    "name": "example-vpc-origin",
    "arn": this["arn"],
    "http_port": 8080,
    "https_port": 8443,
    "origin_protocol_policy": "https-only",
    "origin_ssl_protocols": {
        "items": ["TLSv1.2"],
        "quantity": 1,
    },
})
package main
import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/cloudfront"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := cloudfront.NewVpcOrigin(ctx, "alb", &cloudfront.VpcOriginArgs{
			VpcOriginEndpointConfig: &cloudfront.VpcOriginVpcOriginEndpointConfigArgs{
				Name:                 pulumi.String("example-vpc-origin"),
				Arn:                  pulumi.Any(this.Arn),
				HttpPort:             pulumi.Int(8080),
				HttpsPort:            pulumi.Int(8443),
				OriginProtocolPolicy: pulumi.String("https-only"),
				OriginSslProtocols: &cloudfront.VpcOriginVpcOriginEndpointConfigOriginSslProtocolsArgs{
					Items: pulumi.StringArray{
						pulumi.String("TLSv1.2"),
					},
					Quantity: pulumi.Int(1),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() => 
{
    var alb = new Aws.CloudFront.VpcOrigin("alb", new()
    {
        VpcOriginEndpointConfig = new Aws.CloudFront.Inputs.VpcOriginVpcOriginEndpointConfigArgs
        {
            Name = "example-vpc-origin",
            Arn = @this.Arn,
            HttpPort = 8080,
            HttpsPort = 8443,
            OriginProtocolPolicy = "https-only",
            OriginSslProtocols = new Aws.CloudFront.Inputs.VpcOriginVpcOriginEndpointConfigOriginSslProtocolsArgs
            {
                Items = new[]
                {
                    "TLSv1.2",
                },
                Quantity = 1,
            },
        },
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.cloudfront.VpcOrigin;
import com.pulumi.aws.cloudfront.VpcOriginArgs;
import com.pulumi.aws.cloudfront.inputs.VpcOriginVpcOriginEndpointConfigArgs;
import com.pulumi.aws.cloudfront.inputs.VpcOriginVpcOriginEndpointConfigOriginSslProtocolsArgs;
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 alb = new VpcOrigin("alb", VpcOriginArgs.builder()
            .vpcOriginEndpointConfig(VpcOriginVpcOriginEndpointConfigArgs.builder()
                .name("example-vpc-origin")
                .arn(this_.arn())
                .httpPort(8080)
                .httpsPort(8443)
                .originProtocolPolicy("https-only")
                .originSslProtocols(VpcOriginVpcOriginEndpointConfigOriginSslProtocolsArgs.builder()
                    .items("TLSv1.2")
                    .quantity(1)
                    .build())
                .build())
            .build());
    }
}
resources:
  alb:
    type: aws:cloudfront:VpcOrigin
    properties:
      vpcOriginEndpointConfig:
        name: example-vpc-origin
        arn: ${this.arn}
        httpPort: 8080
        httpsPort: 8443
        originProtocolPolicy: https-only
        originSslProtocols:
          items:
            - TLSv1.2
          quantity: 1
Create VpcOrigin Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new VpcOrigin(name: string, args?: VpcOriginArgs, opts?: CustomResourceOptions);@overload
def VpcOrigin(resource_name: str,
              args: Optional[VpcOriginArgs] = None,
              opts: Optional[ResourceOptions] = None)
@overload
def VpcOrigin(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              tags: Optional[Mapping[str, str]] = None,
              timeouts: Optional[VpcOriginTimeoutsArgs] = None,
              vpc_origin_endpoint_config: Optional[VpcOriginVpcOriginEndpointConfigArgs] = None)func NewVpcOrigin(ctx *Context, name string, args *VpcOriginArgs, opts ...ResourceOption) (*VpcOrigin, error)public VpcOrigin(string name, VpcOriginArgs? args = null, CustomResourceOptions? opts = null)
public VpcOrigin(String name, VpcOriginArgs args)
public VpcOrigin(String name, VpcOriginArgs args, CustomResourceOptions options)
type: aws:cloudfront:VpcOrigin
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args VpcOriginArgs
- 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 VpcOriginArgs
- 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 VpcOriginArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args VpcOriginArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args VpcOriginArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var vpcOriginResource = new Aws.CloudFront.VpcOrigin("vpcOriginResource", new()
{
    Tags = 
    {
        { "string", "string" },
    },
    Timeouts = new Aws.CloudFront.Inputs.VpcOriginTimeoutsArgs
    {
        Create = "string",
        Delete = "string",
        Update = "string",
    },
    VpcOriginEndpointConfig = new Aws.CloudFront.Inputs.VpcOriginVpcOriginEndpointConfigArgs
    {
        Arn = "string",
        HttpPort = 0,
        HttpsPort = 0,
        Name = "string",
        OriginProtocolPolicy = "string",
        OriginSslProtocols = new Aws.CloudFront.Inputs.VpcOriginVpcOriginEndpointConfigOriginSslProtocolsArgs
        {
            Items = new[]
            {
                "string",
            },
            Quantity = 0,
        },
    },
});
example, err := cloudfront.NewVpcOrigin(ctx, "vpcOriginResource", &cloudfront.VpcOriginArgs{
	Tags: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
	Timeouts: &cloudfront.VpcOriginTimeoutsArgs{
		Create: pulumi.String("string"),
		Delete: pulumi.String("string"),
		Update: pulumi.String("string"),
	},
	VpcOriginEndpointConfig: &cloudfront.VpcOriginVpcOriginEndpointConfigArgs{
		Arn:                  pulumi.String("string"),
		HttpPort:             pulumi.Int(0),
		HttpsPort:            pulumi.Int(0),
		Name:                 pulumi.String("string"),
		OriginProtocolPolicy: pulumi.String("string"),
		OriginSslProtocols: &cloudfront.VpcOriginVpcOriginEndpointConfigOriginSslProtocolsArgs{
			Items: pulumi.StringArray{
				pulumi.String("string"),
			},
			Quantity: pulumi.Int(0),
		},
	},
})
var vpcOriginResource = new VpcOrigin("vpcOriginResource", VpcOriginArgs.builder()
    .tags(Map.of("string", "string"))
    .timeouts(VpcOriginTimeoutsArgs.builder()
        .create("string")
        .delete("string")
        .update("string")
        .build())
    .vpcOriginEndpointConfig(VpcOriginVpcOriginEndpointConfigArgs.builder()
        .arn("string")
        .httpPort(0)
        .httpsPort(0)
        .name("string")
        .originProtocolPolicy("string")
        .originSslProtocols(VpcOriginVpcOriginEndpointConfigOriginSslProtocolsArgs.builder()
            .items("string")
            .quantity(0)
            .build())
        .build())
    .build());
vpc_origin_resource = aws.cloudfront.VpcOrigin("vpcOriginResource",
    tags={
        "string": "string",
    },
    timeouts={
        "create": "string",
        "delete": "string",
        "update": "string",
    },
    vpc_origin_endpoint_config={
        "arn": "string",
        "http_port": 0,
        "https_port": 0,
        "name": "string",
        "origin_protocol_policy": "string",
        "origin_ssl_protocols": {
            "items": ["string"],
            "quantity": 0,
        },
    })
const vpcOriginResource = new aws.cloudfront.VpcOrigin("vpcOriginResource", {
    tags: {
        string: "string",
    },
    timeouts: {
        create: "string",
        "delete": "string",
        update: "string",
    },
    vpcOriginEndpointConfig: {
        arn: "string",
        httpPort: 0,
        httpsPort: 0,
        name: "string",
        originProtocolPolicy: "string",
        originSslProtocols: {
            items: ["string"],
            quantity: 0,
        },
    },
});
type: aws:cloudfront:VpcOrigin
properties:
    tags:
        string: string
    timeouts:
        create: string
        delete: string
        update: string
    vpcOriginEndpointConfig:
        arn: string
        httpPort: 0
        httpsPort: 0
        name: string
        originProtocolPolicy: string
        originSslProtocols:
            items:
                - string
            quantity: 0
VpcOrigin Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The VpcOrigin resource accepts the following input properties:
- Dictionary<string, string>
- Timeouts
VpcOrigin Timeouts 
- VpcOrigin VpcEndpoint Config Origin Vpc Origin Endpoint Config 
- Map<String,String>
- timeouts
VpcOrigin Timeouts 
- vpcOrigin VpcEndpoint Config Origin Vpc Origin Endpoint Config 
- {[key: string]: string}
- timeouts
VpcOrigin Timeouts 
- vpcOrigin VpcEndpoint Config Origin Vpc Origin Endpoint Config 
Outputs
All input properties are implicitly available as output properties. Additionally, the VpcOrigin resource produces the following output properties:
Look up Existing VpcOrigin Resource
Get an existing VpcOrigin 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?: VpcOriginState, opts?: CustomResourceOptions): VpcOrigin@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        arn: Optional[str] = None,
        etag: Optional[str] = None,
        tags: Optional[Mapping[str, str]] = None,
        tags_all: Optional[Mapping[str, str]] = None,
        timeouts: Optional[VpcOriginTimeoutsArgs] = None,
        vpc_origin_endpoint_config: Optional[VpcOriginVpcOriginEndpointConfigArgs] = None) -> VpcOriginfunc GetVpcOrigin(ctx *Context, name string, id IDInput, state *VpcOriginState, opts ...ResourceOption) (*VpcOrigin, error)public static VpcOrigin Get(string name, Input<string> id, VpcOriginState? state, CustomResourceOptions? opts = null)public static VpcOrigin get(String name, Output<String> id, VpcOriginState state, CustomResourceOptions options)resources:  _:    type: aws:cloudfront:VpcOrigin    get:      id: ${id}- 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.
- Arn string
- The VPC origin ARN.
- Etag string
- The current version of the origin.
- Dictionary<string, string>
- Dictionary<string, string>
- A map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- Timeouts
VpcOrigin Timeouts 
- VpcOrigin VpcEndpoint Config Origin Vpc Origin Endpoint Config 
- Arn string
- The VPC origin ARN.
- Etag string
- The current version of the origin.
- map[string]string
- map[string]string
- A map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- Timeouts
VpcOrigin Timeouts Args 
- VpcOrigin VpcEndpoint Config Origin Vpc Origin Endpoint Config Args 
- arn String
- The VPC origin ARN.
- etag String
- The current version of the origin.
- Map<String,String>
- Map<String,String>
- A map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- timeouts
VpcOrigin Timeouts 
- vpcOrigin VpcEndpoint Config Origin Vpc Origin Endpoint Config 
- arn string
- The VPC origin ARN.
- etag string
- The current version of the origin.
- {[key: string]: string}
- {[key: string]: string}
- A map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- timeouts
VpcOrigin Timeouts 
- vpcOrigin VpcEndpoint Config Origin Vpc Origin Endpoint Config 
- arn str
- The VPC origin ARN.
- etag str
- The current version of the origin.
- Mapping[str, str]
- Mapping[str, str]
- A map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- timeouts
VpcOrigin Timeouts Args 
- vpc_origin_ Vpcendpoint_ config Origin Vpc Origin Endpoint Config Args 
- arn String
- The VPC origin ARN.
- etag String
- The current version of the origin.
- Map<String>
- Map<String>
- A map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- timeouts Property Map
- vpcOrigin Property MapEndpoint Config 
Supporting Types
VpcOriginTimeouts, VpcOriginTimeoutsArgs      
- Create string
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- Delete string
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
- Update string
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- Create string
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- Delete string
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
- Update string
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- create String
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- delete String
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
- update String
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- create string
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- delete string
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
- update string
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- create str
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- delete str
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
- update str
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- create String
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- delete String
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
- update String
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
VpcOriginVpcOriginEndpointConfig, VpcOriginVpcOriginEndpointConfigArgs            
- Arn string
- The VPC origin ARN.
- HttpPort int
- The HTTP port for the CloudFront VPC origin endpoint configuration.
- HttpsPort int
- The HTTPS port for the CloudFront VPC origin endpoint configuration.
- Name string
- The name of the CloudFront VPC origin endpoint configuration.
- OriginProtocol stringPolicy 
- The origin protocol policy for the CloudFront VPC origin endpoint configuration.
- OriginSsl VpcProtocols Origin Vpc Origin Endpoint Config Origin Ssl Protocols 
- A complex type that contains information about the SSL/TLS protocols that CloudFront can use when establishing an HTTPS connection with your origin.
- Arn string
- The VPC origin ARN.
- HttpPort int
- The HTTP port for the CloudFront VPC origin endpoint configuration.
- HttpsPort int
- The HTTPS port for the CloudFront VPC origin endpoint configuration.
- Name string
- The name of the CloudFront VPC origin endpoint configuration.
- OriginProtocol stringPolicy 
- The origin protocol policy for the CloudFront VPC origin endpoint configuration.
- OriginSsl VpcProtocols Origin Vpc Origin Endpoint Config Origin Ssl Protocols 
- A complex type that contains information about the SSL/TLS protocols that CloudFront can use when establishing an HTTPS connection with your origin.
- arn String
- The VPC origin ARN.
- httpPort Integer
- The HTTP port for the CloudFront VPC origin endpoint configuration.
- httpsPort Integer
- The HTTPS port for the CloudFront VPC origin endpoint configuration.
- name String
- The name of the CloudFront VPC origin endpoint configuration.
- originProtocol StringPolicy 
- The origin protocol policy for the CloudFront VPC origin endpoint configuration.
- originSsl VpcProtocols Origin Vpc Origin Endpoint Config Origin Ssl Protocols 
- A complex type that contains information about the SSL/TLS protocols that CloudFront can use when establishing an HTTPS connection with your origin.
- arn string
- The VPC origin ARN.
- httpPort number
- The HTTP port for the CloudFront VPC origin endpoint configuration.
- httpsPort number
- The HTTPS port for the CloudFront VPC origin endpoint configuration.
- name string
- The name of the CloudFront VPC origin endpoint configuration.
- originProtocol stringPolicy 
- The origin protocol policy for the CloudFront VPC origin endpoint configuration.
- originSsl VpcProtocols Origin Vpc Origin Endpoint Config Origin Ssl Protocols 
- A complex type that contains information about the SSL/TLS protocols that CloudFront can use when establishing an HTTPS connection with your origin.
- arn str
- The VPC origin ARN.
- http_port int
- The HTTP port for the CloudFront VPC origin endpoint configuration.
- https_port int
- The HTTPS port for the CloudFront VPC origin endpoint configuration.
- name str
- The name of the CloudFront VPC origin endpoint configuration.
- origin_protocol_ strpolicy 
- The origin protocol policy for the CloudFront VPC origin endpoint configuration.
- origin_ssl_ Vpcprotocols Origin Vpc Origin Endpoint Config Origin Ssl Protocols 
- A complex type that contains information about the SSL/TLS protocols that CloudFront can use when establishing an HTTPS connection with your origin.
- arn String
- The VPC origin ARN.
- httpPort Number
- The HTTP port for the CloudFront VPC origin endpoint configuration.
- httpsPort Number
- The HTTPS port for the CloudFront VPC origin endpoint configuration.
- name String
- The name of the CloudFront VPC origin endpoint configuration.
- originProtocol StringPolicy 
- The origin protocol policy for the CloudFront VPC origin endpoint configuration.
- originSsl Property MapProtocols 
- A complex type that contains information about the SSL/TLS protocols that CloudFront can use when establishing an HTTPS connection with your origin.
VpcOriginVpcOriginEndpointConfigOriginSslProtocols, VpcOriginVpcOriginEndpointConfigOriginSslProtocolsArgs                  
Import
terraform
import {
to = aws_cloudfront_vpc_origin.origin
id = “vo_JQEa410sssUFoY6wMkx69j”
}
Using pulumi import, import Cloudfront VPC origins using the id. For example:
console
% pulumi import aws_cloudfront_vpc_origin vo_JQEa410sssUFoY6wMkx69j
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the awsTerraform Provider.