1. Packages
  2. AWS Classic
  3. API Docs
  4. schemas
  5. RegistryPolicy

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.32.0 published on Friday, Apr 19, 2024 by Pulumi

aws.schemas.RegistryPolicy

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.32.0 published on Friday, Apr 19, 2024 by Pulumi

    Resource for managing an AWS EventBridge Schemas Registry Policy.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = aws.iam.getPolicyDocument({
        statements: [{
            sid: "example",
            effect: "Allow",
            principals: [{
                type: "AWS",
                identifiers: ["109876543210"],
            }],
            actions: ["schemas:*"],
            resources: [
                "arn:aws:schemas:us-east-1:012345678901:registry/example",
                "arn:aws:schemas:us-east-1:012345678901:schema/example*",
            ],
        }],
    });
    const exampleRegistryPolicy = new aws.schemas.RegistryPolicy("example", {
        registryName: "example",
        policy: example.then(example => example.json),
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.iam.get_policy_document(statements=[aws.iam.GetPolicyDocumentStatementArgs(
        sid="example",
        effect="Allow",
        principals=[aws.iam.GetPolicyDocumentStatementPrincipalArgs(
            type="AWS",
            identifiers=["109876543210"],
        )],
        actions=["schemas:*"],
        resources=[
            "arn:aws:schemas:us-east-1:012345678901:registry/example",
            "arn:aws:schemas:us-east-1:012345678901:schema/example*",
        ],
    )])
    example_registry_policy = aws.schemas.RegistryPolicy("example",
        registry_name="example",
        policy=example.json)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iam"
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/schemas"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := iam.GetPolicyDocument(ctx, &iam.GetPolicyDocumentArgs{
    			Statements: []iam.GetPolicyDocumentStatement{
    				{
    					Sid:    pulumi.StringRef("example"),
    					Effect: pulumi.StringRef("Allow"),
    					Principals: []iam.GetPolicyDocumentStatementPrincipal{
    						{
    							Type: "AWS",
    							Identifiers: []string{
    								"109876543210",
    							},
    						},
    					},
    					Actions: []string{
    						"schemas:*",
    					},
    					Resources: []string{
    						"arn:aws:schemas:us-east-1:012345678901:registry/example",
    						"arn:aws:schemas:us-east-1:012345678901:schema/example*",
    					},
    				},
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = schemas.NewRegistryPolicy(ctx, "example", &schemas.RegistryPolicyArgs{
    			RegistryName: pulumi.String("example"),
    			Policy:       pulumi.String(example.Json),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Aws.Iam.GetPolicyDocument.Invoke(new()
        {
            Statements = new[]
            {
                new Aws.Iam.Inputs.GetPolicyDocumentStatementInputArgs
                {
                    Sid = "example",
                    Effect = "Allow",
                    Principals = new[]
                    {
                        new Aws.Iam.Inputs.GetPolicyDocumentStatementPrincipalInputArgs
                        {
                            Type = "AWS",
                            Identifiers = new[]
                            {
                                "109876543210",
                            },
                        },
                    },
                    Actions = new[]
                    {
                        "schemas:*",
                    },
                    Resources = new[]
                    {
                        "arn:aws:schemas:us-east-1:012345678901:registry/example",
                        "arn:aws:schemas:us-east-1:012345678901:schema/example*",
                    },
                },
            },
        });
    
        var exampleRegistryPolicy = new Aws.Schemas.RegistryPolicy("example", new()
        {
            RegistryName = "example",
            Policy = example.Apply(getPolicyDocumentResult => getPolicyDocumentResult.Json),
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.iam.IamFunctions;
    import com.pulumi.aws.iam.inputs.GetPolicyDocumentArgs;
    import com.pulumi.aws.schemas.RegistryPolicy;
    import com.pulumi.aws.schemas.RegistryPolicyArgs;
    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 = IamFunctions.getPolicyDocument(GetPolicyDocumentArgs.builder()
                .statements(GetPolicyDocumentStatementArgs.builder()
                    .sid("example")
                    .effect("Allow")
                    .principals(GetPolicyDocumentStatementPrincipalArgs.builder()
                        .type("AWS")
                        .identifiers("109876543210")
                        .build())
                    .actions("schemas:*")
                    .resources(                
                        "arn:aws:schemas:us-east-1:012345678901:registry/example",
                        "arn:aws:schemas:us-east-1:012345678901:schema/example*")
                    .build())
                .build());
    
            var exampleRegistryPolicy = new RegistryPolicy("exampleRegistryPolicy", RegistryPolicyArgs.builder()        
                .registryName("example")
                .policy(example.applyValue(getPolicyDocumentResult -> getPolicyDocumentResult.json()))
                .build());
    
        }
    }
    
    resources:
      exampleRegistryPolicy:
        type: aws:schemas:RegistryPolicy
        name: example
        properties:
          registryName: example
          policy: ${example.json}
    variables:
      example:
        fn::invoke:
          Function: aws:iam:getPolicyDocument
          Arguments:
            statements:
              - sid: example
                effect: Allow
                principals:
                  - type: AWS
                    identifiers:
                      - '109876543210'
                actions:
                  - schemas:*
                resources:
                  - arn:aws:schemas:us-east-1:012345678901:registry/example
                  - arn:aws:schemas:us-east-1:012345678901:schema/example*
    

    Create RegistryPolicy Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

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

    Example

    The following reference example uses placeholder values for all input properties.

    var awsRegistryPolicyResource = new Aws.Schemas.RegistryPolicy("awsRegistryPolicyResource", new()
    {
        Policy = "string",
        RegistryName = "string",
    });
    
    example, err := schemas.NewRegistryPolicy(ctx, "awsRegistryPolicyResource", &schemas.RegistryPolicyArgs{
    	Policy:       pulumi.String("string"),
    	RegistryName: pulumi.String("string"),
    })
    
    var awsRegistryPolicyResource = new RegistryPolicy("awsRegistryPolicyResource", RegistryPolicyArgs.builder()        
        .policy("string")
        .registryName("string")
        .build());
    
    aws_registry_policy_resource = aws.schemas.RegistryPolicy("awsRegistryPolicyResource",
        policy="string",
        registry_name="string")
    
    const awsRegistryPolicyResource = new aws.schemas.RegistryPolicy("awsRegistryPolicyResource", {
        policy: "string",
        registryName: "string",
    });
    
    type: aws:schemas:RegistryPolicy
    properties:
        policy: string
        registryName: string
    

    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 string
    Resource Policy for EventBridge Schema Registry
    RegistryName string
    Name of EventBridge Schema Registry
    Policy string
    Resource Policy for EventBridge Schema Registry
    RegistryName string
    Name of EventBridge Schema Registry
    policy String
    Resource Policy for EventBridge Schema Registry
    registryName String
    Name of EventBridge Schema Registry
    policy string
    Resource Policy for EventBridge Schema Registry
    registryName string
    Name of EventBridge Schema Registry
    policy str
    Resource Policy for EventBridge Schema Registry
    registry_name str
    Name of EventBridge Schema Registry
    policy String
    Resource Policy for EventBridge Schema Registry
    registryName String
    Name of EventBridge Schema Registry

    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 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 RegistryPolicy Resource

    Get an existing RegistryPolicy 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?: RegistryPolicyState, opts?: CustomResourceOptions): RegistryPolicy
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            policy: Optional[str] = None,
            registry_name: Optional[str] = None) -> RegistryPolicy
    func GetRegistryPolicy(ctx *Context, name string, id IDInput, state *RegistryPolicyState, opts ...ResourceOption) (*RegistryPolicy, error)
    public static RegistryPolicy Get(string name, Input<string> id, RegistryPolicyState? state, CustomResourceOptions? opts = null)
    public static RegistryPolicy get(String name, Output<String> id, RegistryPolicyState 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.
    The following state arguments are supported:
    Policy string
    Resource Policy for EventBridge Schema Registry
    RegistryName string
    Name of EventBridge Schema Registry
    Policy string
    Resource Policy for EventBridge Schema Registry
    RegistryName string
    Name of EventBridge Schema Registry
    policy String
    Resource Policy for EventBridge Schema Registry
    registryName String
    Name of EventBridge Schema Registry
    policy string
    Resource Policy for EventBridge Schema Registry
    registryName string
    Name of EventBridge Schema Registry
    policy str
    Resource Policy for EventBridge Schema Registry
    registry_name str
    Name of EventBridge Schema Registry
    policy String
    Resource Policy for EventBridge Schema Registry
    registryName String
    Name of EventBridge Schema Registry

    Import

    Using pulumi import, import EventBridge Schema Registry Policy using the registry_name. For example:

    $ pulumi import aws:schemas/registryPolicy:RegistryPolicy example example
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.32.0 published on Friday, Apr 19, 2024 by Pulumi