AWS Classic

Pulumi Official
Package maintained by Pulumi
v5.9.2 published on Friday, Jun 24, 2022 by Pulumi

getOriginAccessIdentities

Use this data source to get ARNs, ids and S3 canonical user IDs of Amazon CloudFront origin access identities.

Example Usage

All origin access identities in the account

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var example = Output.Create(Aws.CloudFront.GetOriginAccessIdentities.InvokeAsync());
    }

}
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.GetOriginAccessIdentities(ctx, nil, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

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

    public static void stack(Context ctx) {
        final var example = Output.of(CloudfrontFunctions.getOriginAccessIdentities());

    }
}
import pulumi
import pulumi_aws as aws

example = aws.cloudfront.get_origin_access_identities()
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = pulumi.output(aws.cloudfront.getOriginAccessIdentities());
variables:
  example:
    Fn::Invoke:
      Function: aws:cloudfront:getOriginAccessIdentities
      Arguments: {}

Origin access identities filtered by comment/name

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var example = Output.Create(Aws.CloudFront.GetOriginAccessIdentities.InvokeAsync(new Aws.CloudFront.GetOriginAccessIdentitiesArgs
        {
            Comments = 
            {
                "example-comment1",
                "example-comment2",
            },
        }));
    }

}
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.GetOriginAccessIdentities(ctx, &cloudfront.GetOriginAccessIdentitiesArgs{
			Comments: []string{
				"example-comment1",
				"example-comment2",
			},
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

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

    public static void stack(Context ctx) {
        final var example = Output.of(CloudfrontFunctions.getOriginAccessIdentities(GetOriginAccessIdentitiesArgs.builder()
            .comments(            
                "example-comment1",
                "example-comment2")
            .build()));

    }
}
import pulumi
import pulumi_aws as aws

example = aws.cloudfront.get_origin_access_identities(comments=[
    "example-comment1",
    "example-comment2",
])
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = pulumi.output(aws.cloudfront.getOriginAccessIdentities({
    comments: [
        "example-comment1",
        "example-comment2",
    ],
}));
variables:
  example:
    Fn::Invoke:
      Function: aws:cloudfront:getOriginAccessIdentities
      Arguments:
        comments:
          - example-comment1
          - example-comment2

Using getOriginAccessIdentities

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getOriginAccessIdentities(args: GetOriginAccessIdentitiesArgs, opts?: InvokeOptions): Promise<GetOriginAccessIdentitiesResult>
function getOriginAccessIdentitiesOutput(args: GetOriginAccessIdentitiesOutputArgs, opts?: InvokeOptions): Output<GetOriginAccessIdentitiesResult>
def get_origin_access_identities(comments: Optional[Sequence[str]] = None,
                                 opts: Optional[InvokeOptions] = None) -> GetOriginAccessIdentitiesResult
def get_origin_access_identities_output(comments: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                                 opts: Optional[InvokeOptions] = None) -> Output[GetOriginAccessIdentitiesResult]
func GetOriginAccessIdentities(ctx *Context, args *GetOriginAccessIdentitiesArgs, opts ...InvokeOption) (*GetOriginAccessIdentitiesResult, error)
func GetOriginAccessIdentitiesOutput(ctx *Context, args *GetOriginAccessIdentitiesOutputArgs, opts ...InvokeOption) GetOriginAccessIdentitiesResultOutput

> Note: This function is named GetOriginAccessIdentities in the Go SDK.

public static class GetOriginAccessIdentities 
{
    public static Task<GetOriginAccessIdentitiesResult> InvokeAsync(GetOriginAccessIdentitiesArgs args, InvokeOptions? opts = null)
    public static Output<GetOriginAccessIdentitiesResult> Invoke(GetOriginAccessIdentitiesInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetOriginAccessIdentitiesResult> getOriginAccessIdentities(GetOriginAccessIdentitiesArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: aws:cloudfront/getOriginAccessIdentities:getOriginAccessIdentities
  Arguments:
    # Arguments dictionary

The following arguments are supported:

Comments List<string>

Filter origin access identities by comment.

Comments []string

Filter origin access identities by comment.

comments List<String>

Filter origin access identities by comment.

comments string[]

Filter origin access identities by comment.

comments Sequence[str]

Filter origin access identities by comment.

comments List<String>

Filter origin access identities by comment.

getOriginAccessIdentities Result

The following output properties are available:

IamArns List<string>

Set of ARNs of the matched origin access identities.

Id string

The provider-assigned unique ID for this managed resource.

Ids List<string>

Set of ids of the matched origin access identities.

S3CanonicalUserIds List<string>

Set of S3 canonical user IDs of the matched origin access identities.

Comments List<string>
IamArns []string

Set of ARNs of the matched origin access identities.

Id string

The provider-assigned unique ID for this managed resource.

Ids []string

Set of ids of the matched origin access identities.

S3CanonicalUserIds []string

Set of S3 canonical user IDs of the matched origin access identities.

Comments []string
iamArns List<String>

Set of ARNs of the matched origin access identities.

id String

The provider-assigned unique ID for this managed resource.

ids List<String>

Set of ids of the matched origin access identities.

s3CanonicalUserIds List<String>

Set of S3 canonical user IDs of the matched origin access identities.

comments List<String>
iamArns string[]

Set of ARNs of the matched origin access identities.

id string

The provider-assigned unique ID for this managed resource.

ids string[]

Set of ids of the matched origin access identities.

s3CanonicalUserIds string[]

Set of S3 canonical user IDs of the matched origin access identities.

comments string[]
iam_arns Sequence[str]

Set of ARNs of the matched origin access identities.

id str

The provider-assigned unique ID for this managed resource.

ids Sequence[str]

Set of ids of the matched origin access identities.

s3_canonical_user_ids Sequence[str]

Set of S3 canonical user IDs of the matched origin access identities.

comments Sequence[str]
iamArns List<String>

Set of ARNs of the matched origin access identities.

id String

The provider-assigned unique ID for this managed resource.

ids List<String>

Set of ids of the matched origin access identities.

s3CanonicalUserIds List<String>

Set of S3 canonical user IDs of the matched origin access identities.

comments List<String>

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.