Show / Hide Table of Contents

Class GetBucket

Inheritance
System.Object
GetBucket
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.Aws.S3
Assembly: Pulumi.Aws.dll
Syntax
public static class GetBucket

Methods

View Source

InvokeAsync(GetBucketArgs, InvokeOptions)

Provides details about a specific S3 bucket.

This resource may prove useful when setting up a Route53 record, or an origin for a CloudFront Distribution.

{{% examples %}}

Example Usage

{{% example %}}

Route53 Record

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
public MyStack()
{
    var selected = Output.Create(Aws.S3.GetBucket.InvokeAsync(new Aws.S3.GetBucketArgs
    {
        Bucket = "bucket.test.com",
    }));
    var testZone = Output.Create(Aws.Route53.GetZone.InvokeAsync(new Aws.Route53.GetZoneArgs
    {
        Name = "test.com.",
    }));
    var example = new Aws.Route53.Record("example", new Aws.Route53.RecordArgs
    {
        Aliases = 
        {
            new Aws.Route53.Inputs.RecordAliasArgs
            {
                Name = selected.Apply(selected => selected.WebsiteDomain),
                ZoneId = selected.Apply(selected => selected.HostedZoneId),
            },
        },
        Name = "bucket",
        Type = "A",
        ZoneId = testZone.Apply(testZone => testZone.Id),
    });
}

}

{{% /example %}} {{% example %}}

CloudFront Origin

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
public MyStack()
{
    var selected = Output.Create(Aws.S3.GetBucket.InvokeAsync(new Aws.S3.GetBucketArgs
    {
        Bucket = "a-test-bucket",
    }));
    var test = new Aws.CloudFront.Distribution("test", new Aws.CloudFront.DistributionArgs
    {
        Origins = 
        {
            new Aws.CloudFront.Inputs.DistributionOriginArgs
            {
                DomainName = selected.Apply(selected => selected.BucketDomainName),
                OriginId = "s3-selected-bucket",
            },
        },
    });
}

}

{{% /example %}} {{% /examples %}}

Declaration
public static Task<GetBucketResult> InvokeAsync(GetBucketArgs args, InvokeOptions options = null)
Parameters
Type Name Description
GetBucketArgs args
InvokeOptions options
Returns
Type Description
System.Threading.Tasks.Task<GetBucketResult>
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.