Show / Hide Table of Contents

Class GetPartition

Inheritance
System.Object
GetPartition
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
Assembly: Pulumi.Aws.dll
Syntax
public static class GetPartition

Methods

View Source

InvokeAsync(InvokeOptions)

Use this data source to lookup current AWS partition in which this provider is working

{{% examples %}}

Example Usage

{{% example %}}

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
public MyStack()
{
    var current = Output.Create(Aws.GetPartition.InvokeAsync());
    var s3Policy = current.Apply(current => Output.Create(Aws.Iam.GetPolicyDocument.InvokeAsync(new Aws.Iam.GetPolicyDocumentArgs
    {
        Statements = 
        {
            new Aws.Iam.Inputs.GetPolicyDocumentStatementArgs
            {
                Actions = 
                {
                    "s3:ListBucket",
                },
                Resources = 
                {
                    $"arn:{current.Partition}:s3:::my-bucket",
                },
                Sid = "1",
            },
        },
    })));
}

}

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

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