aws logo
AWS Classic v5.29.0, Feb 1 23

aws.cloudfront.OriginAccessControl

Manages an AWS CloudFront Origin Access Control, which is used by CloudFront Distributions with an Amazon S3 bucket as the origin.

Read more about Origin Access Control in the CloudFront Developer Guide.

Example Usage

Basic Usage

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

return await Deployment.RunAsync(() => 
{
    var example = new Aws.CloudFront.OriginAccessControl("example", new()
    {
        Description = "Example Policy",
        OriginAccessControlOriginType = "s3",
        SigningBehavior = "always",
        SigningProtocol = "sigv4",
    });

});
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := cloudfront.NewOriginAccessControl(ctx, "example", &cloudfront.OriginAccessControlArgs{
			Description:                   pulumi.String("Example Policy"),
			OriginAccessControlOriginType: pulumi.String("s3"),
			SigningBehavior:               pulumi.String("always"),
			SigningProtocol:               pulumi.String("sigv4"),
		})
		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.cloudfront.OriginAccessControl;
import com.pulumi.aws.cloudfront.OriginAccessControlArgs;
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 example = new OriginAccessControl("example", OriginAccessControlArgs.builder()        
            .description("Example Policy")
            .originAccessControlOriginType("s3")
            .signingBehavior("always")
            .signingProtocol("sigv4")
            .build());

    }
}
import pulumi
import pulumi_aws as aws

example = aws.cloudfront.OriginAccessControl("example",
    description="Example Policy",
    origin_access_control_origin_type="s3",
    signing_behavior="always",
    signing_protocol="sigv4")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.cloudfront.OriginAccessControl("example", {
    description: "Example Policy",
    originAccessControlOriginType: "s3",
    signingBehavior: "always",
    signingProtocol: "sigv4",
});
resources:
  example:
    type: aws:cloudfront:OriginAccessControl
    properties:
      description: Example Policy
      originAccessControlOriginType: s3
      signingBehavior: always
      signingProtocol: sigv4

Create OriginAccessControl Resource

new OriginAccessControl(name: string, args: OriginAccessControlArgs, opts?: CustomResourceOptions);
@overload
def OriginAccessControl(resource_name: str,
                        opts: Optional[ResourceOptions] = None,
                        description: Optional[str] = None,
                        name: Optional[str] = None,
                        origin_access_control_origin_type: Optional[str] = None,
                        signing_behavior: Optional[str] = None,
                        signing_protocol: Optional[str] = None)
@overload
def OriginAccessControl(resource_name: str,
                        args: OriginAccessControlArgs,
                        opts: Optional[ResourceOptions] = None)
func NewOriginAccessControl(ctx *Context, name string, args OriginAccessControlArgs, opts ...ResourceOption) (*OriginAccessControl, error)
public OriginAccessControl(string name, OriginAccessControlArgs args, CustomResourceOptions? opts = null)
public OriginAccessControl(String name, OriginAccessControlArgs args)
public OriginAccessControl(String name, OriginAccessControlArgs args, CustomResourceOptions options)
type: aws:cloudfront:OriginAccessControl
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args OriginAccessControlArgs
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 OriginAccessControlArgs
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 OriginAccessControlArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args OriginAccessControlArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args OriginAccessControlArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

OriginAccessControl 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 OriginAccessControl resource accepts the following input properties:

OriginAccessControlOriginType string

The type of origin that this Origin Access Control is for. The only valid value is s3.

SigningBehavior string

Specifies which requests CloudFront signs. Specify always for the most common use case. Allowed values: always, never, no-override.

SigningProtocol string

Determines how CloudFront signs (authenticates) requests. Valid values: sigv4.

Description string

The description of the Origin Access Control. It may be empty.

Name string

A name that identifies the Origin Access Control.

OriginAccessControlOriginType string

The type of origin that this Origin Access Control is for. The only valid value is s3.

SigningBehavior string

Specifies which requests CloudFront signs. Specify always for the most common use case. Allowed values: always, never, no-override.

SigningProtocol string

Determines how CloudFront signs (authenticates) requests. Valid values: sigv4.

Description string

The description of the Origin Access Control. It may be empty.

Name string

A name that identifies the Origin Access Control.

originAccessControlOriginType String

The type of origin that this Origin Access Control is for. The only valid value is s3.

signingBehavior String

Specifies which requests CloudFront signs. Specify always for the most common use case. Allowed values: always, never, no-override.

signingProtocol String

Determines how CloudFront signs (authenticates) requests. Valid values: sigv4.

description String

The description of the Origin Access Control. It may be empty.

name String

A name that identifies the Origin Access Control.

originAccessControlOriginType string

The type of origin that this Origin Access Control is for. The only valid value is s3.

signingBehavior string

Specifies which requests CloudFront signs. Specify always for the most common use case. Allowed values: always, never, no-override.

signingProtocol string

Determines how CloudFront signs (authenticates) requests. Valid values: sigv4.

description string

The description of the Origin Access Control. It may be empty.

name string

A name that identifies the Origin Access Control.

origin_access_control_origin_type str

The type of origin that this Origin Access Control is for. The only valid value is s3.

signing_behavior str

Specifies which requests CloudFront signs. Specify always for the most common use case. Allowed values: always, never, no-override.

signing_protocol str

Determines how CloudFront signs (authenticates) requests. Valid values: sigv4.

description str

The description of the Origin Access Control. It may be empty.

name str

A name that identifies the Origin Access Control.

originAccessControlOriginType String

The type of origin that this Origin Access Control is for. The only valid value is s3.

signingBehavior String

Specifies which requests CloudFront signs. Specify always for the most common use case. Allowed values: always, never, no-override.

signingProtocol String

Determines how CloudFront signs (authenticates) requests. Valid values: sigv4.

description String

The description of the Origin Access Control. It may be empty.

name String

A name that identifies the Origin Access Control.

Outputs

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

Etag string

The current version of this Origin Access Control.

Id string

The provider-assigned unique ID for this managed resource.

Etag string

The current version of this Origin Access Control.

Id string

The provider-assigned unique ID for this managed resource.

etag String

The current version of this Origin Access Control.

id String

The provider-assigned unique ID for this managed resource.

etag string

The current version of this Origin Access Control.

id string

The provider-assigned unique ID for this managed resource.

etag str

The current version of this Origin Access Control.

id str

The provider-assigned unique ID for this managed resource.

etag String

The current version of this Origin Access Control.

id String

The provider-assigned unique ID for this managed resource.

Look up Existing OriginAccessControl Resource

Get an existing OriginAccessControl 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?: OriginAccessControlState, opts?: CustomResourceOptions): OriginAccessControl
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        description: Optional[str] = None,
        etag: Optional[str] = None,
        name: Optional[str] = None,
        origin_access_control_origin_type: Optional[str] = None,
        signing_behavior: Optional[str] = None,
        signing_protocol: Optional[str] = None) -> OriginAccessControl
func GetOriginAccessControl(ctx *Context, name string, id IDInput, state *OriginAccessControlState, opts ...ResourceOption) (*OriginAccessControl, error)
public static OriginAccessControl Get(string name, Input<string> id, OriginAccessControlState? state, CustomResourceOptions? opts = null)
public static OriginAccessControl get(String name, Output<String> id, OriginAccessControlState 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:
Description string

The description of the Origin Access Control. It may be empty.

Etag string

The current version of this Origin Access Control.

Name string

A name that identifies the Origin Access Control.

OriginAccessControlOriginType string

The type of origin that this Origin Access Control is for. The only valid value is s3.

SigningBehavior string

Specifies which requests CloudFront signs. Specify always for the most common use case. Allowed values: always, never, no-override.

SigningProtocol string

Determines how CloudFront signs (authenticates) requests. Valid values: sigv4.

Description string

The description of the Origin Access Control. It may be empty.

Etag string

The current version of this Origin Access Control.

Name string

A name that identifies the Origin Access Control.

OriginAccessControlOriginType string

The type of origin that this Origin Access Control is for. The only valid value is s3.

SigningBehavior string

Specifies which requests CloudFront signs. Specify always for the most common use case. Allowed values: always, never, no-override.

SigningProtocol string

Determines how CloudFront signs (authenticates) requests. Valid values: sigv4.

description String

The description of the Origin Access Control. It may be empty.

etag String

The current version of this Origin Access Control.

name String

A name that identifies the Origin Access Control.

originAccessControlOriginType String

The type of origin that this Origin Access Control is for. The only valid value is s3.

signingBehavior String

Specifies which requests CloudFront signs. Specify always for the most common use case. Allowed values: always, never, no-override.

signingProtocol String

Determines how CloudFront signs (authenticates) requests. Valid values: sigv4.

description string

The description of the Origin Access Control. It may be empty.

etag string

The current version of this Origin Access Control.

name string

A name that identifies the Origin Access Control.

originAccessControlOriginType string

The type of origin that this Origin Access Control is for. The only valid value is s3.

signingBehavior string

Specifies which requests CloudFront signs. Specify always for the most common use case. Allowed values: always, never, no-override.

signingProtocol string

Determines how CloudFront signs (authenticates) requests. Valid values: sigv4.

description str

The description of the Origin Access Control. It may be empty.

etag str

The current version of this Origin Access Control.

name str

A name that identifies the Origin Access Control.

origin_access_control_origin_type str

The type of origin that this Origin Access Control is for. The only valid value is s3.

signing_behavior str

Specifies which requests CloudFront signs. Specify always for the most common use case. Allowed values: always, never, no-override.

signing_protocol str

Determines how CloudFront signs (authenticates) requests. Valid values: sigv4.

description String

The description of the Origin Access Control. It may be empty.

etag String

The current version of this Origin Access Control.

name String

A name that identifies the Origin Access Control.

originAccessControlOriginType String

The type of origin that this Origin Access Control is for. The only valid value is s3.

signingBehavior String

Specifies which requests CloudFront signs. Specify always for the most common use case. Allowed values: always, never, no-override.

signingProtocol String

Determines how CloudFront signs (authenticates) requests. Valid values: sigv4.

Import

CloudFront Origin Access Control can be imported using the id. For example

 $ pulumi import aws:cloudfront/originAccessControl:OriginAccessControl example E327GJI25M56DG

Package Details

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

This Pulumi package is based on the aws Terraform Provider.