Minio

Pulumi Official
Package maintained by Pulumi
v0.4.1 published on Tuesday, May 31, 2022 by Pulumi

getIamPolicyDocument

Example Usage

using Pulumi;
using Minio = Pulumi.Minio;

class MyStack : Stack
{
    public MyStack()
    {
        var example = Output.Create(Minio.GetIamPolicyDocument.InvokeAsync(new Minio.GetIamPolicyDocumentArgs
        {
            Statements = 
            {
                new Minio.Inputs.GetIamPolicyDocumentStatementArgs
                {
                    Sid = "1",
                    Actions = 
                    {
                        "s3:ListAllMyBuckets",
                        "s3:GetBucketLocation",
                    },
                    Resources = 
                    {
                        "arn:aws:s3:::*",
                    },
                },
                new Minio.Inputs.GetIamPolicyDocumentStatementArgs
                {
                    Actions = 
                    {
                        "s3:ListBucket",
                    },
                    Resources = 
                    {
                        "arn:aws:s3:::state-terraform-s3",
                    },
                    Conditions = 
                    {
                        new Minio.Inputs.GetIamPolicyDocumentStatementConditionArgs
                        {
                            Test = "StringLike",
                            Variable = "s3:prefix",
                            Values = 
                            {
                                "",
                                "home/",
                            },
                        },
                    },
                },
                new Minio.Inputs.GetIamPolicyDocumentStatementArgs
                {
                    Actions = 
                    {
                        "s3:PutObject",
                    },
                    Resources = 
                    {
                        "arn:aws:s3:::state-terraform-s3",
                        "arn:aws:s3:::state-terraform-s3/*",
                    },
                },
            },
        }));
        var testPolicy = new Minio.IamPolicy("testPolicy", new Minio.IamPolicyArgs
        {
            Policy = example.Apply(example => example.Json),
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-minio/sdk/go/minio"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := minio.GetIamPolicyDocument(ctx, &GetIamPolicyDocumentArgs{
			Statements: []GetIamPolicyDocumentStatement{
				GetIamPolicyDocumentStatement{
					Sid: pulumi.StringRef("1"),
					Actions: []string{
						"s3:ListAllMyBuckets",
						"s3:GetBucketLocation",
					},
					Resources: []string{
						"arn:aws:s3:::*",
					},
				},
				GetIamPolicyDocumentStatement{
					Actions: []string{
						"s3:ListBucket",
					},
					Resources: []string{
						"arn:aws:s3:::state-terraform-s3",
					},
					Conditions: []GetIamPolicyDocumentStatementCondition{
						GetIamPolicyDocumentStatementCondition{
							Test:     "StringLike",
							Variable: "s3:prefix",
							Values: []string{
								"",
								"home/",
							},
						},
					},
				},
				GetIamPolicyDocumentStatement{
					Actions: []string{
						"s3:PutObject",
					},
					Resources: []string{
						"arn:aws:s3:::state-terraform-s3",
						"arn:aws:s3:::state-terraform-s3/*",
					},
				},
			},
		}, nil)
		if err != nil {
			return err
		}
		_, err = minio.NewIamPolicy(ctx, "testPolicy", &minio.IamPolicyArgs{
			Policy: pulumi.String(example.Json),
		})
		if err != nil {
			return err
		}
		return nil
	})
}

Coming soon!

import pulumi
import pulumi_minio as minio

example = minio.get_iam_policy_document(statements=[
    minio.GetIamPolicyDocumentStatementArgs(
        sid="1",
        actions=[
            "s3:ListAllMyBuckets",
            "s3:GetBucketLocation",
        ],
        resources=["arn:aws:s3:::*"],
    ),
    minio.GetIamPolicyDocumentStatementArgs(
        actions=["s3:ListBucket"],
        resources=["arn:aws:s3:::state-terraform-s3"],
        conditions=[minio.GetIamPolicyDocumentStatementConditionArgs(
            test="StringLike",
            variable="s3:prefix",
            values=[
                "",
                "home/",
            ],
        )],
    ),
    minio.GetIamPolicyDocumentStatementArgs(
        actions=["s3:PutObject"],
        resources=[
            "arn:aws:s3:::state-terraform-s3",
            "arn:aws:s3:::state-terraform-s3/*",
        ],
    ),
])
test_policy = minio.IamPolicy("testPolicy", policy=example.json)
import * as pulumi from "@pulumi/pulumi";
import * as minio from "@pulumi/minio";

const example = minio.getIamPolicyDocument({
    statements: [
        {
            sid: "1",
            actions: [
                "s3:ListAllMyBuckets",
                "s3:GetBucketLocation",
            ],
            resources: ["arn:aws:s3:::*"],
        },
        {
            actions: ["s3:ListBucket"],
            resources: ["arn:aws:s3:::state-terraform-s3"],
            conditions: [{
                test: "StringLike",
                variable: "s3:prefix",
                values: [
                    "",
                    "home/",
                ],
            }],
        },
        {
            actions: ["s3:PutObject"],
            resources: [
                "arn:aws:s3:::state-terraform-s3",
                "arn:aws:s3:::state-terraform-s3/*",
            ],
        },
    ],
});
const testPolicy = new minio.IamPolicy("testPolicy", {policy: example.then(example => example.json)});

Coming soon!

Using getIamPolicyDocument

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 getIamPolicyDocument(args: GetIamPolicyDocumentArgs, opts?: InvokeOptions): Promise<GetIamPolicyDocumentResult>
function getIamPolicyDocumentOutput(args: GetIamPolicyDocumentOutputArgs, opts?: InvokeOptions): Output<GetIamPolicyDocumentResult>
def get_iam_policy_document(override_json: Optional[str] = None,
                            policy_id: Optional[str] = None,
                            source_json: Optional[str] = None,
                            statements: Optional[Sequence[GetIamPolicyDocumentStatement]] = None,
                            version: Optional[str] = None,
                            opts: Optional[InvokeOptions] = None) -> GetIamPolicyDocumentResult
def get_iam_policy_document_output(override_json: Optional[pulumi.Input[str]] = None,
                            policy_id: Optional[pulumi.Input[str]] = None,
                            source_json: Optional[pulumi.Input[str]] = None,
                            statements: Optional[pulumi.Input[Sequence[pulumi.Input[GetIamPolicyDocumentStatementArgs]]]] = None,
                            version: Optional[pulumi.Input[str]] = None,
                            opts: Optional[InvokeOptions] = None) -> Output[GetIamPolicyDocumentResult]
func GetIamPolicyDocument(ctx *Context, args *GetIamPolicyDocumentArgs, opts ...InvokeOption) (*GetIamPolicyDocumentResult, error)
func GetIamPolicyDocumentOutput(ctx *Context, args *GetIamPolicyDocumentOutputArgs, opts ...InvokeOption) GetIamPolicyDocumentResultOutput

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

public static class GetIamPolicyDocument 
{
    public static Task<GetIamPolicyDocumentResult> InvokeAsync(GetIamPolicyDocumentArgs args, InvokeOptions? opts = null)
    public static Output<GetIamPolicyDocumentResult> Invoke(GetIamPolicyDocumentInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetIamPolicyDocumentResult> getIamPolicyDocument(GetIamPolicyDocumentArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: minio:index/getIamPolicyDocument:getIamPolicyDocument
  Arguments:
    # Arguments dictionary

The following arguments are supported:

getIamPolicyDocument Result

The following output properties are available:

Id string

The provider-assigned unique ID for this managed resource.

Json string
OverrideJson string
PolicyId string
SourceJson string
Statements List<GetIamPolicyDocumentStatement>
Version string
Id string

The provider-assigned unique ID for this managed resource.

Json string
OverrideJson string
PolicyId string
SourceJson string
Statements []GetIamPolicyDocumentStatement
Version string
id String

The provider-assigned unique ID for this managed resource.

json String
overrideJson String
policyId String
sourceJson String
statements List<GetIamPolicyDocumentStatement>
version String
id string

The provider-assigned unique ID for this managed resource.

json string
overrideJson string
policyId string
sourceJson string
statements GetIamPolicyDocumentStatement[]
version string
id str

The provider-assigned unique ID for this managed resource.

json str
override_json str
policy_id str
source_json str
statements Sequence[GetIamPolicyDocumentStatement]
version str
id String

The provider-assigned unique ID for this managed resource.

json String
overrideJson String
policyId String
sourceJson String
statements List<Property Map>
version String

Supporting Types

GetIamPolicyDocumentStatement

actions List<String>
conditions List<Property Map>
effect String
principal String
resources List<String>
sid String

GetIamPolicyDocumentStatementCondition

Test string
Values List<string>
Variable string
Test string
Values []string
Variable string
test String
values List<String>
variable String
test string
values string[]
variable string
test str
values Sequence[str]
variable str
test String
values List<String>
variable String

Package Details

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

This Pulumi package is based on the minio Terraform Provider.