1. Packages
  2. AWS
  3. API Docs
  4. schemas
  5. RegistryPolicy
AWS v6.77.0 published on Wednesday, Apr 9, 2025 by Pulumi

aws.schemas.RegistryPolicy

Explore with Pulumi AI

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:123456789012:registry/example",
            "arn:aws:schemas:us-east-1:123456789012:schema/example*",
        ],
    }],
});
const exampleRegistryPolicy = new aws.schemas.RegistryPolicy("example", {
    registryName: "example",
    policy: example.then(example => example.json),
});
Copy
import pulumi
import pulumi_aws as aws

example = aws.iam.get_policy_document(statements=[{
    "sid": "example",
    "effect": "Allow",
    "principals": [{
        "type": "AWS",
        "identifiers": ["109876543210"],
    }],
    "actions": ["schemas:*"],
    "resources": [
        "arn:aws:schemas:us-east-1:123456789012:registry/example",
        "arn:aws:schemas:us-east-1:123456789012:schema/example*",
    ],
}])
example_registry_policy = aws.schemas.RegistryPolicy("example",
    registry_name="example",
    policy=example.json)
Copy
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:123456789012:registry/example",
						"arn:aws:schemas:us-east-1:123456789012: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
	})
}
Copy
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:123456789012:registry/example",
                    "arn:aws:schemas:us-east-1:123456789012:schema/example*",
                },
            },
        },
    });

    var exampleRegistryPolicy = new Aws.Schemas.RegistryPolicy("example", new()
    {
        RegistryName = "example",
        Policy = example.Apply(getPolicyDocumentResult => getPolicyDocumentResult.Json),
    });

});
Copy
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:123456789012:registry/example",
                    "arn:aws:schemas:us-east-1:123456789012:schema/example*")
                .build())
            .build());

        var exampleRegistryPolicy = new RegistryPolicy("exampleRegistryPolicy", RegistryPolicyArgs.builder()
            .registryName("example")
            .policy(example.json())
            .build());

    }
}
Copy
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:123456789012:registry/example
              - arn:aws:schemas:us-east-1:123456789012:schema/example*
Copy

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 This property is required. string
The unique name of the resource.
args This property is required. RegistryPolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. 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 This property is required. string
The unique name of the resource.
args This property is required. RegistryPolicyArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. RegistryPolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. RegistryPolicyArgs
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 awsRegistryPolicyResource = new Aws.Schemas.RegistryPolicy("awsRegistryPolicyResource", new()
{
    Policy = "string",
    RegistryName = "string",
});
Copy
example, err := schemas.NewRegistryPolicy(ctx, "awsRegistryPolicyResource", &schemas.RegistryPolicyArgs{
	Policy:       pulumi.String("string"),
	RegistryName: pulumi.String("string"),
})
Copy
var awsRegistryPolicyResource = new RegistryPolicy("awsRegistryPolicyResource", RegistryPolicyArgs.builder()
    .policy("string")
    .registryName("string")
    .build());
Copy
aws_registry_policy_resource = aws.schemas.RegistryPolicy("awsRegistryPolicyResource",
    policy="string",
    registry_name="string")
Copy
const awsRegistryPolicyResource = new aws.schemas.RegistryPolicy("awsRegistryPolicyResource", {
    policy: "string",
    registryName: "string",
});
Copy
type: aws:schemas:RegistryPolicy
properties:
    policy: string
    registryName: string
Copy

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

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The RegistryPolicy resource accepts the following input properties:

Policy This property is required. string
Resource Policy for EventBridge Schema Registry
RegistryName
This property is required.
Changes to this property will trigger replacement.
string
Name of EventBridge Schema Registry
Policy This property is required. string
Resource Policy for EventBridge Schema Registry
RegistryName
This property is required.
Changes to this property will trigger replacement.
string
Name of EventBridge Schema Registry
policy This property is required. String
Resource Policy for EventBridge Schema Registry
registryName
This property is required.
Changes to this property will trigger replacement.
String
Name of EventBridge Schema Registry
policy This property is required. string
Resource Policy for EventBridge Schema Registry
registryName
This property is required.
Changes to this property will trigger replacement.
string
Name of EventBridge Schema Registry
policy This property is required. str
Resource Policy for EventBridge Schema Registry
registry_name
This property is required.
Changes to this property will trigger replacement.
str
Name of EventBridge Schema Registry
policy This property is required. String
Resource Policy for EventBridge Schema Registry
registryName
This property is required.
Changes to this property will trigger replacement.
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)
resources:  _:    type: aws:schemas:RegistryPolicy    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 Changes to this property will trigger replacement. string
Name of EventBridge Schema Registry
Policy string
Resource Policy for EventBridge Schema Registry
RegistryName Changes to this property will trigger replacement. string
Name of EventBridge Schema Registry
policy String
Resource Policy for EventBridge Schema Registry
registryName Changes to this property will trigger replacement. String
Name of EventBridge Schema Registry
policy string
Resource Policy for EventBridge Schema Registry
registryName Changes to this property will trigger replacement. string
Name of EventBridge Schema Registry
policy str
Resource Policy for EventBridge Schema Registry
registry_name Changes to this property will trigger replacement. str
Name of EventBridge Schema Registry
policy String
Resource Policy for EventBridge Schema Registry
registryName Changes to this property will trigger replacement. 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
Copy

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.