MinIO v0.15.4 published on Monday, Jun 24, 2024 by Pulumi
minio.getIamPolicyDocument
Explore with Pulumi AI
Example Usage
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("test_policy", {
name: "state-terraform-s3",
policy: example.then(example => example.json),
});
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("test_policy",
name="state-terraform-s3",
policy=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, &minio.GetIamPolicyDocumentArgs{
Statements: pulumi.Array{
minio.GetIamPolicyDocumentStatement{
Sid: pulumi.StringRef("1"),
Actions: []string{
"s3:ListAllMyBuckets",
"s3:GetBucketLocation",
},
Resources: []string{
"arn:aws:s3:::*",
},
},
minio.GetIamPolicyDocumentStatement{
Actions: []string{
"s3:ListBucket",
},
Resources: []string{
"arn:aws:s3:::state-terraform-s3",
},
Conditions: []minio.GetIamPolicyDocumentStatementCondition{
{
Test: "StringLike",
Variable: "s3:prefix",
Values: []string{
"",
"home/",
},
},
},
},
minio.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, "test_policy", &minio.IamPolicyArgs{
Name: pulumi.String("state-terraform-s3"),
Policy: pulumi.String(example.Json),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Minio = Pulumi.Minio;
return await Deployment.RunAsync(() =>
{
var example = Minio.GetIamPolicyDocument.Invoke(new()
{
Statements = new[]
{
new Minio.Inputs.GetIamPolicyDocumentStatementInputArgs
{
Sid = "1",
Actions = new[]
{
"s3:ListAllMyBuckets",
"s3:GetBucketLocation",
},
Resources = new[]
{
"arn:aws:s3:::*",
},
},
new Minio.Inputs.GetIamPolicyDocumentStatementInputArgs
{
Actions = new[]
{
"s3:ListBucket",
},
Resources = new[]
{
"arn:aws:s3:::state-terraform-s3",
},
Conditions = new[]
{
new Minio.Inputs.GetIamPolicyDocumentStatementConditionInputArgs
{
Test = "StringLike",
Variable = "s3:prefix",
Values = new[]
{
"",
"home/",
},
},
},
},
new Minio.Inputs.GetIamPolicyDocumentStatementInputArgs
{
Actions = new[]
{
"s3:PutObject",
},
Resources = new[]
{
"arn:aws:s3:::state-terraform-s3",
"arn:aws:s3:::state-terraform-s3/*",
},
},
},
});
var testPolicy = new Minio.IamPolicy("test_policy", new()
{
Name = "state-terraform-s3",
Policy = example.Apply(getIamPolicyDocumentResult => getIamPolicyDocumentResult.Json),
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.minio.MinioFunctions;
import com.pulumi.minio.inputs.GetIamPolicyDocumentArgs;
import com.pulumi.minio.IamPolicy;
import com.pulumi.minio.IamPolicyArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var example = MinioFunctions.getIamPolicyDocument(GetIamPolicyDocumentArgs.builder()
.statements(
GetIamPolicyDocumentStatementArgs.builder()
.sid("1")
.actions(
"s3:ListAllMyBuckets",
"s3:GetBucketLocation")
.resources("arn:aws:s3:::*")
.build(),
GetIamPolicyDocumentStatementArgs.builder()
.actions("s3:ListBucket")
.resources("arn:aws:s3:::state-terraform-s3")
.conditions(GetIamPolicyDocumentStatementConditionArgs.builder()
.test("StringLike")
.variable("s3:prefix")
.values(
"",
"home/")
.build())
.build(),
GetIamPolicyDocumentStatementArgs.builder()
.actions("s3:PutObject")
.resources(
"arn:aws:s3:::state-terraform-s3",
"arn:aws:s3:::state-terraform-s3/*")
.build())
.build());
var testPolicy = new IamPolicy("testPolicy", IamPolicyArgs.builder()
.name("state-terraform-s3")
.policy(example.applyValue(getIamPolicyDocumentResult -> getIamPolicyDocumentResult.json()))
.build());
}
}
resources:
testPolicy:
type: minio:IamPolicy
name: test_policy
properties:
name: state-terraform-s3
policy: ${example.json}
variables:
example:
fn::invoke:
Function: minio:getIamPolicyDocument
Arguments:
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/*
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:
- Override
Json string - Policy
Id string - Source
Json string - Statements
List<Get
Iam Policy Document Statement> - Version string
- Override
Json string - Policy
Id string - Source
Json string - Statements
[]Get
Iam Policy Document Statement - Version string
- override
Json String - policy
Id String - source
Json String - statements
List<Get
Iam Policy Document Statement> - version String
- override
Json string - policy
Id string - source
Json string - statements
Get
Iam Policy Document Statement[] - version string
- override
Json String - policy
Id String - source
Json String - statements List<Property Map>
- version String
getIamPolicyDocument Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- Json string
- Override
Json string - Policy
Id string - Source
Json string - Statements
List<Get
Iam Policy Document Statement> - Version string
- Id string
- The provider-assigned unique ID for this managed resource.
- Json string
- Override
Json string - Policy
Id string - Source
Json string - Statements
[]Get
Iam Policy Document Statement - Version string
- id String
- The provider-assigned unique ID for this managed resource.
- json String
- override
Json String - policy
Id String - source
Json String - statements
List<Get
Iam Policy Document Statement> - version String
- id string
- The provider-assigned unique ID for this managed resource.
- json string
- override
Json string - policy
Id string - source
Json string - statements
Get
Iam Policy Document Statement[] - 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[Get
Iam Policy Document Statement] - version str
- id String
- The provider-assigned unique ID for this managed resource.
- json String
- override
Json String - policy
Id String - source
Json String - statements List<Property Map>
- version String
Supporting Types
GetIamPolicyDocumentStatement
- Actions List<string>
- Conditions
List<Get
Iam Policy Document Statement Condition> - Effect string
- Principal string
- Resources List<string>
- Sid string
- Actions []string
- Conditions
[]Get
Iam Policy Document Statement Condition - Effect string
- Principal string
- Resources []string
- Sid string
- actions List<String>
- conditions
List<Get
Iam Policy Document Statement Condition> - effect String
- principal String
- resources List<String>
- sid String
- actions string[]
- conditions
Get
Iam Policy Document Statement Condition[] - effect string
- principal string
- resources string[]
- sid string
- actions Sequence[str]
- conditions
Sequence[Get
Iam Policy Document Statement Condition] - effect str
- principal str
- resources Sequence[str]
- sid str
- actions List<String>
- conditions List<Property Map>
- effect String
- principal String
- resources List<String>
- sid String
GetIamPolicyDocumentStatementCondition
Package Details
- Repository
- MinIO pulumi/pulumi-minio
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
minio
Terraform Provider.