RegistryPolicy

Resource Type definition for AWS::EventSchemas::RegistryPolicy

Example Usage

Example

using Pulumi;
using AwsNative = Pulumi.AwsNative;

class MyStack : Stack
{
    public MyStack()
    {
        var registryPolicy = new AwsNative.EventSchemas.RegistryPolicy("registryPolicy", new AwsNative.EventSchemas.RegistryPolicyArgs
        {
            RegistryName = "registryName",
            Policy = 
            {
                { "version", "2012-10-17" },
                { "statement", 
                {
                    { "sid", 1 },
                    { "effect", "Allow" },
                    { "principal", 
                    {
                        { "aws", "arn:aws:iam::012345678901:user/TestAccountForRegistryPolicy" },
                    } },
                    { "action", 
                    {
                        "schemas:DescribeRegistry",
                        "schemas:CreateSchema",
                    } },
                    { "resource", "registryArn" },
                } },
            },
        });
    }

}

package main

import (
	"github.com/pulumi/pulumi-aws-native/sdk/go/aws/eventschemas"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := eventschemas.NewRegistryPolicy(ctx, "registryPolicy", &eventschemas.RegistryPolicyArgs{
			RegistryName: pulumi.String("registryName"),
			Policy: pulumi.Any{
				Version: "2012-10-17",
				Statement: map[string]interface{}{
					"sid":    1,
					"effect": "Allow",
					"principal": map[string]interface{}{
						"aws": "arn:aws:iam::012345678901:user/TestAccountForRegistryPolicy",
					},
					"action": []string{
						"schemas:DescribeRegistry",
						"schemas:CreateSchema",
					},
					"resource": "registryArn",
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}

import pulumi
import pulumi_aws_native as aws_native

registry_policy = aws_native.eventschemas.RegistryPolicy("registryPolicy",
    registry_name="registryName",
    policy={
        "version": "2012-10-17",
        "statement": {
            "sid": 1,
            "effect": "Allow",
            "principal": {
                "aws": "arn:aws:iam::012345678901:user/TestAccountForRegistryPolicy",
            },
            "action": [
                "schemas:DescribeRegistry",
                "schemas:CreateSchema",
            ],
            "resource": "registryArn",
        },
    })

import * as pulumi from "@pulumi/pulumi";
import * as aws_native from "@pulumi/aws-native";

const registryPolicy = new aws_native.eventschemas.RegistryPolicy("registryPolicy", {
    registryName: "registryName",
    policy: {
        version: "2012-10-17",
        statement: {
            sid: 1,
            effect: "Allow",
            principal: {
                aws: "arn:aws:iam::012345678901:user/TestAccountForRegistryPolicy",
            },
            action: [
                "schemas:DescribeRegistry",
                "schemas:CreateSchema",
            ],
            resource: "registryArn",
        },
    },
});

Example

using Pulumi;
using AwsNative = Pulumi.AwsNative;

class MyStack : Stack
{
    public MyStack()
    {
        var registryPolicy = new AwsNative.EventSchemas.RegistryPolicy("registryPolicy", new AwsNative.EventSchemas.RegistryPolicyArgs
        {
            RegistryName = "MyRegistry",
            Policy = 
            {
                { "version", "2012-10-17" },
                { "statement", 
                {
                    
                    {
                        { "sid", "Test" },
                        { "effect", "Allow" },
                        { "action", 
                        {
                            "schemas:*",
                        } },
                        { "principal", 
                        {
                            { "aws", 
                            {
                                "109876543210",
                            } },
                        } },
                        { "resource", 
                        {
                            "arn:aws:schemas:us-east-1:012345678901:registry/MyRegistry",
                            "arn:aws:schemas:us-east-1:012345678901:schema/MyRegistry*",
                        } },
                    },
                } },
            },
        });
    }

}

package main

import (
	"github.com/pulumi/pulumi-aws-native/sdk/go/aws/eventschemas"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := eventschemas.NewRegistryPolicy(ctx, "registryPolicy", &eventschemas.RegistryPolicyArgs{
			RegistryName: pulumi.String("MyRegistry"),
			Policy: pulumi.Any{
				Version: "2012-10-17",
				Statement: []map[string]interface{}{
					map[string]interface{}{
						"sid":    "Test",
						"effect": "Allow",
						"action": []string{
							"schemas:*",
						},
						"principal": map[string]interface{}{
							"aws": []string{
								"109876543210",
							},
						},
						"resource": []string{
							"arn:aws:schemas:us-east-1:012345678901:registry/MyRegistry",
							"arn:aws:schemas:us-east-1:012345678901:schema/MyRegistry*",
						},
					},
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}

import pulumi
import pulumi_aws_native as aws_native

registry_policy = aws_native.eventschemas.RegistryPolicy("registryPolicy",
    registry_name="MyRegistry",
    policy={
        "version": "2012-10-17",
        "statement": [{
            "sid": "Test",
            "effect": "Allow",
            "action": ["schemas:*"],
            "principal": {
                "aws": ["109876543210"],
            },
            "resource": [
                "arn:aws:schemas:us-east-1:012345678901:registry/MyRegistry",
                "arn:aws:schemas:us-east-1:012345678901:schema/MyRegistry*",
            ],
        }],
    })

import * as pulumi from "@pulumi/pulumi";
import * as aws_native from "@pulumi/aws-native";

const registryPolicy = new aws_native.eventschemas.RegistryPolicy("registryPolicy", {
    registryName: "MyRegistry",
    policy: {
        version: "2012-10-17",
        statement: [{
            sid: "Test",
            effect: "Allow",
            action: ["schemas:*"],
            principal: {
                aws: ["109876543210"],
            },
            resource: [
                "arn:aws:schemas:us-east-1:012345678901:registry/MyRegistry",
                "arn:aws:schemas:us-east-1:012345678901:schema/MyRegistry*",
            ],
        }],
    },
});

Example

using Pulumi;
using AwsNative = Pulumi.AwsNative;

class MyStack : Stack
{
    public MyStack()
    {
        var registryPolicy = new AwsNative.EventSchemas.RegistryPolicy("registryPolicy", new AwsNative.EventSchemas.RegistryPolicyArgs
        {
            RegistryName = "MyRegistry",
            Policy = 
            {
                { "version", "2012-10-17" },
                { "statement", 
                {
                    
                    {
                        { "sid", "Test" },
                        { "effect", "Allow" },
                        { "action", 
                        {
                            "schemas:*",
                        } },
                        { "principal", 
                        {
                            { "aws", 
                            {
                                "109876543210",
                            } },
                        } },
                        { "resource", 
                        {
                            "arn:aws:schemas:us-east-1:012345678901:registry/MyRegistry",
                            "arn:aws:schemas:us-east-1:012345678901:schema/MyRegistry*",
                        } },
                    },
                } },
            },
        });
    }

}

package main

import (
	"github.com/pulumi/pulumi-aws-native/sdk/go/aws/eventschemas"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := eventschemas.NewRegistryPolicy(ctx, "registryPolicy", &eventschemas.RegistryPolicyArgs{
			RegistryName: pulumi.String("MyRegistry"),
			Policy: pulumi.Any{
				Version: "2012-10-17",
				Statement: []map[string]interface{}{
					map[string]interface{}{
						"sid":    "Test",
						"effect": "Allow",
						"action": []string{
							"schemas:*",
						},
						"principal": map[string]interface{}{
							"aws": []string{
								"109876543210",
							},
						},
						"resource": []string{
							"arn:aws:schemas:us-east-1:012345678901:registry/MyRegistry",
							"arn:aws:schemas:us-east-1:012345678901:schema/MyRegistry*",
						},
					},
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}

import pulumi
import pulumi_aws_native as aws_native

registry_policy = aws_native.eventschemas.RegistryPolicy("registryPolicy",
    registry_name="MyRegistry",
    policy={
        "version": "2012-10-17",
        "statement": [{
            "sid": "Test",
            "effect": "Allow",
            "action": ["schemas:*"],
            "principal": {
                "aws": ["109876543210"],
            },
            "resource": [
                "arn:aws:schemas:us-east-1:012345678901:registry/MyRegistry",
                "arn:aws:schemas:us-east-1:012345678901:schema/MyRegistry*",
            ],
        }],
    })

import * as pulumi from "@pulumi/pulumi";
import * as aws_native from "@pulumi/aws-native";

const registryPolicy = new aws_native.eventschemas.RegistryPolicy("registryPolicy", {
    registryName: "MyRegistry",
    policy: {
        version: "2012-10-17",
        statement: [{
            sid: "Test",
            effect: "Allow",
            action: ["schemas:*"],
            principal: {
                aws: ["109876543210"],
            },
            resource: [
                "arn:aws:schemas:us-east-1:012345678901:registry/MyRegistry",
                "arn:aws:schemas:us-east-1:012345678901:schema/MyRegistry*",
            ],
        }],
    },
});

Create a RegistryPolicy Resource

new RegistryPolicy(name: string, args: RegistryPolicyArgs, opts?: CustomResourceOptions);
@overload
def RegistryPolicy(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   policy: Optional[Any] = None,
                   registry_name: Optional[str] = None,
                   revision_id: Optional[str] = None)
@overload
def RegistryPolicy(resource_name: str,
                   args: RegistryPolicyArgs,
                   opts: Optional[ResourceOptions] = None)
func NewRegistryPolicy(ctx *Context, name string, args RegistryPolicyArgs, opts ...ResourceOption) (*RegistryPolicy, error)
public RegistryPolicy(string name, RegistryPolicyArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args RegistryPolicyArgs
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 RegistryPolicyArgs
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 RegistryPolicyArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args RegistryPolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

RegistryPolicy Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The RegistryPolicy resource accepts the following input properties:

Policy object
RegistryName string
RevisionId string
Policy interface{}
RegistryName string
RevisionId string
policy any
registryName string
revisionId string

Outputs

All input properties are implicitly available as output properties. Additionally, the RegistryPolicy 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 str
The provider-assigned unique ID for this managed resource.

Package Details

Repository
https://github.com/pulumi/pulumi-aws-native
License
Apache-2.0