minio.IamPolicy
Explore with Pulumi AI
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as minio from "@pulumi/minio";
const testPolicy = new minio.IamPolicy("test_policy", {
name: "state-terraform-s3",
policy: `{
"Version":"2012-10-17",
"Statement": [
{
"Sid":"ListAllBucket",
"Effect": "Allow",
"Action": ["s3:PutObject"],
"Principal":"*",
"Resource": "arn:aws:s3:::state-terraform-s3/*"
}
]
}
`,
});
export const minioId = testPolicy.id;
export const minioPolicy = testPolicy.policy;
import pulumi
import pulumi_minio as minio
test_policy = minio.IamPolicy("test_policy",
name="state-terraform-s3",
policy="""{
"Version":"2012-10-17",
"Statement": [
{
"Sid":"ListAllBucket",
"Effect": "Allow",
"Action": ["s3:PutObject"],
"Principal":"*",
"Resource": "arn:aws:s3:::state-terraform-s3/*"
}
]
}
""")
pulumi.export("minioId", test_policy.id)
pulumi.export("minioPolicy", test_policy.policy)
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 {
testPolicy, err := minio.NewIamPolicy(ctx, "test_policy", &minio.IamPolicyArgs{
Name: pulumi.String("state-terraform-s3"),
Policy: pulumi.String(`{
"Version":"2012-10-17",
"Statement": [
{
"Sid":"ListAllBucket",
"Effect": "Allow",
"Action": ["s3:PutObject"],
"Principal":"*",
"Resource": "arn:aws:s3:::state-terraform-s3/*"
}
]
}
`),
})
if err != nil {
return err
}
ctx.Export("minioId", testPolicy.ID())
ctx.Export("minioPolicy", testPolicy.Policy)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Minio = Pulumi.Minio;
return await Deployment.RunAsync(() =>
{
var testPolicy = new Minio.IamPolicy("test_policy", new()
{
Name = "state-terraform-s3",
Policy = @"{
""Version"":""2012-10-17"",
""Statement"": [
{
""Sid"":""ListAllBucket"",
""Effect"": ""Allow"",
""Action"": [""s3:PutObject""],
""Principal"":""*"",
""Resource"": ""arn:aws:s3:::state-terraform-s3/*""
}
]
}
",
});
return new Dictionary<string, object?>
{
["minioId"] = testPolicy.Id,
["minioPolicy"] = testPolicy.Policy,
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
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) {
var testPolicy = new IamPolicy("testPolicy", IamPolicyArgs.builder()
.name("state-terraform-s3")
.policy("""
{
"Version":"2012-10-17",
"Statement": [
{
"Sid":"ListAllBucket",
"Effect": "Allow",
"Action": ["s3:PutObject"],
"Principal":"*",
"Resource": "arn:aws:s3:::state-terraform-s3/*"
}
]
}
""")
.build());
ctx.export("minioId", testPolicy.id());
ctx.export("minioPolicy", testPolicy.policy());
}
}
resources:
testPolicy:
type: minio:IamPolicy
name: test_policy
properties:
name: state-terraform-s3
policy: |
{
"Version":"2012-10-17",
"Statement": [
{
"Sid":"ListAllBucket",
"Effect": "Allow",
"Action": ["s3:PutObject"],
"Principal":"*",
"Resource": "arn:aws:s3:::state-terraform-s3/*"
}
]
}
outputs:
minioId: ${testPolicy.id}
minioPolicy: ${testPolicy.policy}
Create IamPolicy Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new IamPolicy(name: string, args: IamPolicyArgs, opts?: CustomResourceOptions);
@overload
def IamPolicy(resource_name: str,
args: IamPolicyArgs,
opts: Optional[ResourceOptions] = None)
@overload
def IamPolicy(resource_name: str,
opts: Optional[ResourceOptions] = None,
policy: Optional[str] = None,
name: Optional[str] = None,
name_prefix: Optional[str] = None)
func NewIamPolicy(ctx *Context, name string, args IamPolicyArgs, opts ...ResourceOption) (*IamPolicy, error)
public IamPolicy(string name, IamPolicyArgs args, CustomResourceOptions? opts = null)
public IamPolicy(String name, IamPolicyArgs args)
public IamPolicy(String name, IamPolicyArgs args, CustomResourceOptions options)
type: minio:IamPolicy
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args IamPolicyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args IamPolicyArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args IamPolicyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args IamPolicyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args IamPolicyArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var iamPolicyResource = new Minio.IamPolicy("iamPolicyResource", new()
{
Policy = "string",
Name = "string",
NamePrefix = "string",
});
example, err := minio.NewIamPolicy(ctx, "iamPolicyResource", &minio.IamPolicyArgs{
Policy: pulumi.String("string"),
Name: pulumi.String("string"),
NamePrefix: pulumi.String("string"),
})
var iamPolicyResource = new IamPolicy("iamPolicyResource", IamPolicyArgs.builder()
.policy("string")
.name("string")
.namePrefix("string")
.build());
iam_policy_resource = minio.IamPolicy("iamPolicyResource",
policy="string",
name="string",
name_prefix="string")
const iamPolicyResource = new minio.IamPolicy("iamPolicyResource", {
policy: "string",
name: "string",
namePrefix: "string",
});
type: minio:IamPolicy
properties:
name: string
namePrefix: string
policy: string
IamPolicy Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The IamPolicy resource accepts the following input properties:
- Policy string
- Name string
- Name
Prefix string
- Policy string
- Name string
- Name
Prefix string
- policy String
- name String
- name
Prefix String
- policy string
- name string
- name
Prefix string
- policy str
- name str
- name_
prefix str
- policy String
- name String
- name
Prefix String
Outputs
All input properties are implicitly available as output properties. Additionally, the IamPolicy resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing IamPolicy Resource
Get an existing IamPolicy resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: IamPolicyState, opts?: CustomResourceOptions): IamPolicy
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
name: Optional[str] = None,
name_prefix: Optional[str] = None,
policy: Optional[str] = None) -> IamPolicy
func GetIamPolicy(ctx *Context, name string, id IDInput, state *IamPolicyState, opts ...ResourceOption) (*IamPolicy, error)
public static IamPolicy Get(string name, Input<string> id, IamPolicyState? state, CustomResourceOptions? opts = null)
public static IamPolicy get(String name, Output<String> id, IamPolicyState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Name string
- Name
Prefix string - Policy string
- Name string
- Name
Prefix string - Policy string
- name String
- name
Prefix String - policy String
- name string
- name
Prefix string - policy string
- name str
- name_
prefix str - policy str
- name String
- name
Prefix String - policy String
Package Details
- Repository
- MinIO pulumi/pulumi-minio
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
minio
Terraform Provider.