OriginAccessIdentity
Creates an Amazon CloudFront origin access identity.
For information about CloudFront distributions, see the Amazon CloudFront Developer Guide. For more information on generating origin access identities, see [Using an Origin Access Identity to Restrict Access to Your Amazon S3 Content][2].
Using With CloudFront
Normally, when referencing an origin access identity in CloudFront, you need to
prefix the ID with the origin-access-identity/cloudfront/ special path.
The cloudfront_access_identity_path allows this to be circumvented.
The below snippet demonstrates use with the s3_origin_config structure for the
[aws.cloudfront.Distribution][3] resource:
import * as pulumi from "@pulumi/pulumi";import pulumiusing Pulumi;
class MyStack : Stack
{
public MyStack()
{
}
}
package main
import (
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
return nil
})
}Example Usage
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var originAccessIdentity = new Aws.CloudFront.OriginAccessIdentity("originAccessIdentity", new Aws.CloudFront.OriginAccessIdentityArgs
{
Comment = "Some comment",
});
}
}
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v2/go/aws/cloudfront"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := cloudfront.NewOriginAccessIdentity(ctx, "originAccessIdentity", &cloudfront.OriginAccessIdentityArgs{
Comment: pulumi.String("Some comment"),
})
if err != nil {
return err
}
return nil
})
}import pulumi
import pulumi_aws as aws
origin_access_identity = aws.cloudfront.OriginAccessIdentity("originAccessIdentity", comment="Some comment")import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const originAccessIdentity = new aws.cloudfront.OriginAccessIdentity("origin_access_identity", {
comment: "Some comment",
});Create a OriginAccessIdentity Resource
new OriginAccessIdentity(name: string, args?: OriginAccessIdentityArgs, opts?: CustomResourceOptions);def OriginAccessIdentity(resource_name, opts=None, comment=None, __props__=None);func NewOriginAccessIdentity(ctx *Context, name string, args *OriginAccessIdentityArgs, opts ...ResourceOption) (*OriginAccessIdentity, error)public OriginAccessIdentity(string name, OriginAccessIdentityArgs? args = null, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args OriginAccessIdentityArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args OriginAccessIdentityArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args OriginAccessIdentityArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
OriginAccessIdentity Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The OriginAccessIdentity resource accepts the following input properties:
Outputs
All input properties are implicitly available as output properties. Additionally, the OriginAccessIdentity resource produces the following output properties:
- Caller
Reference string Internal value used by CloudFront to allow future updates to the origin access identity.
- Cloudfront
Access stringIdentity Path A shortcut to the full path for the origin access identity to use in CloudFront, see below.
- Etag string
The current version of the origin access identity’s information. For example:
E2QWRUHAPOMQZL.- Iam
Arn string A pre-generated ARN for use in S3 bucket policies (see below). Example:
arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity E2QWRUHAPOMQZL.- Id string
- The provider-assigned unique ID for this managed resource.
- S3Canonical
User stringId The Amazon S3 canonical user ID for the origin access identity, which you use when giving the origin access identity read permission to an object in Amazon S3.
- Caller
Reference string Internal value used by CloudFront to allow future updates to the origin access identity.
- Cloudfront
Access stringIdentity Path A shortcut to the full path for the origin access identity to use in CloudFront, see below.
- Etag string
The current version of the origin access identity’s information. For example:
E2QWRUHAPOMQZL.- Iam
Arn string A pre-generated ARN for use in S3 bucket policies (see below). Example:
arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity E2QWRUHAPOMQZL.- Id string
- The provider-assigned unique ID for this managed resource.
- S3Canonical
User stringId The Amazon S3 canonical user ID for the origin access identity, which you use when giving the origin access identity read permission to an object in Amazon S3.
- caller
Reference string Internal value used by CloudFront to allow future updates to the origin access identity.
- cloudfront
Access stringIdentity Path A shortcut to the full path for the origin access identity to use in CloudFront, see below.
- etag string
The current version of the origin access identity’s information. For example:
E2QWRUHAPOMQZL.- iam
Arn string A pre-generated ARN for use in S3 bucket policies (see below). Example:
arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity E2QWRUHAPOMQZL.- id string
- The provider-assigned unique ID for this managed resource.
- s3Canonical
User stringId The Amazon S3 canonical user ID for the origin access identity, which you use when giving the origin access identity read permission to an object in Amazon S3.
- caller_
reference str Internal value used by CloudFront to allow future updates to the origin access identity.
- cloudfront_
access_ stridentity_ path A shortcut to the full path for the origin access identity to use in CloudFront, see below.
- etag str
The current version of the origin access identity’s information. For example:
E2QWRUHAPOMQZL.- iam_
arn str A pre-generated ARN for use in S3 bucket policies (see below). Example:
arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity E2QWRUHAPOMQZL.- id str
- The provider-assigned unique ID for this managed resource.
- s3_
canonical_ struser_ id The Amazon S3 canonical user ID for the origin access identity, which you use when giving the origin access identity read permission to an object in Amazon S3.
Look up an Existing OriginAccessIdentity Resource
Get an existing OriginAccessIdentity 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?: OriginAccessIdentityState, opts?: CustomResourceOptions): OriginAccessIdentitystatic get(resource_name, id, opts=None, caller_reference=None, cloudfront_access_identity_path=None, comment=None, etag=None, iam_arn=None, s3_canonical_user_id=None, __props__=None);func GetOriginAccessIdentity(ctx *Context, name string, id IDInput, state *OriginAccessIdentityState, opts ...ResourceOption) (*OriginAccessIdentity, error)public static OriginAccessIdentity Get(string name, Input<string> id, OriginAccessIdentityState? state, CustomResourceOptions? opts = null)- 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.
The following state arguments are supported:
- Caller
Reference string Internal value used by CloudFront to allow future updates to the origin access identity.
- Cloudfront
Access stringIdentity Path A shortcut to the full path for the origin access identity to use in CloudFront, see below.
- Comment string
An optional comment for the origin access identity.
- Etag string
The current version of the origin access identity’s information. For example:
E2QWRUHAPOMQZL.- Iam
Arn string A pre-generated ARN for use in S3 bucket policies (see below). Example:
arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity E2QWRUHAPOMQZL.- S3Canonical
User stringId The Amazon S3 canonical user ID for the origin access identity, which you use when giving the origin access identity read permission to an object in Amazon S3.
- Caller
Reference string Internal value used by CloudFront to allow future updates to the origin access identity.
- Cloudfront
Access stringIdentity Path A shortcut to the full path for the origin access identity to use in CloudFront, see below.
- Comment string
An optional comment for the origin access identity.
- Etag string
The current version of the origin access identity’s information. For example:
E2QWRUHAPOMQZL.- Iam
Arn string A pre-generated ARN for use in S3 bucket policies (see below). Example:
arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity E2QWRUHAPOMQZL.- S3Canonical
User stringId The Amazon S3 canonical user ID for the origin access identity, which you use when giving the origin access identity read permission to an object in Amazon S3.
- caller
Reference string Internal value used by CloudFront to allow future updates to the origin access identity.
- cloudfront
Access stringIdentity Path A shortcut to the full path for the origin access identity to use in CloudFront, see below.
- comment string
An optional comment for the origin access identity.
- etag string
The current version of the origin access identity’s information. For example:
E2QWRUHAPOMQZL.- iam
Arn string A pre-generated ARN for use in S3 bucket policies (see below). Example:
arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity E2QWRUHAPOMQZL.- s3Canonical
User stringId The Amazon S3 canonical user ID for the origin access identity, which you use when giving the origin access identity read permission to an object in Amazon S3.
- caller_
reference str Internal value used by CloudFront to allow future updates to the origin access identity.
- cloudfront_
access_ stridentity_ path A shortcut to the full path for the origin access identity to use in CloudFront, see below.
- comment str
An optional comment for the origin access identity.
- etag str
The current version of the origin access identity’s information. For example:
E2QWRUHAPOMQZL.- iam_
arn str A pre-generated ARN for use in S3 bucket policies (see below). Example:
arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity E2QWRUHAPOMQZL.- s3_
canonical_ struser_ id The Amazon S3 canonical user ID for the origin access identity, which you use when giving the origin access identity read permission to an object in Amazon S3.
Package Details
- Repository
- https://github.com/pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
awsTerraform Provider.