EventPermission

Provides a resource to create a CloudWatch Events permission to support cross-account events in the current account default event bus.

Example Usage

Account Access

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var devAccountAccess = new Aws.CloudWatch.EventPermission("devAccountAccess", new Aws.CloudWatch.EventPermissionArgs
        {
            Principal = "123456789012",
            StatementId = "DevAccountAccess",
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws/cloudwatch"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        _, err := cloudwatch.NewEventPermission(ctx, "devAccountAccess", &cloudwatch.EventPermissionArgs{
            Principal:   pulumi.String("123456789012"),
            StatementId: pulumi.String("DevAccountAccess"),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_aws as aws

dev_account_access = aws.cloudwatch.EventPermission("devAccountAccess",
    principal="123456789012",
    statement_id="DevAccountAccess")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const devAccountAccess = new aws.cloudwatch.EventPermission("DevAccountAccess", {
    principal: "123456789012",
    statementId: "DevAccountAccess",
});

Organization Access

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var organizationAccess = new Aws.CloudWatch.EventPermission("organizationAccess", new Aws.CloudWatch.EventPermissionArgs
        {
            Condition = new Aws.CloudWatch.Inputs.EventPermissionConditionArgs
            {
                Key = "aws:PrincipalOrgID",
                Type = "StringEquals",
                Value = aws_organizations_organization.Example.Id,
            },
            Principal = "*",
            StatementId = "OrganizationAccess",
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws/cloudwatch"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        _, err := cloudwatch.NewEventPermission(ctx, "organizationAccess", &cloudwatch.EventPermissionArgs{
            Condition: &cloudwatch.EventPermissionConditionArgs{
                Key:   pulumi.String("aws:PrincipalOrgID"),
                Type:  pulumi.String("StringEquals"),
                Value: pulumi.String(aws_organizations_organization.Example.Id),
            },
            Principal:   pulumi.String("*"),
            StatementId: pulumi.String("OrganizationAccess"),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_aws as aws

organization_access = aws.cloudwatch.EventPermission("organizationAccess",
    condition={
        "key": "aws:PrincipalOrgID",
        "type": "StringEquals",
        "value": aws_organizations_organization["example"]["id"],
    },
    principal="*",
    statement_id="OrganizationAccess")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const organizationAccess = new aws.cloudwatch.EventPermission("OrganizationAccess", {
    condition: {
        key: "aws:PrincipalOrgID",
        type: "StringEquals",
        value: aws_organizations_organization_example.id,
    },
    principal: "*",
    statementId: "OrganizationAccess",
});

Create a EventPermission Resource

def EventPermission(resource_name, opts=None, action=None, condition=None, principal=None, statement_id=None, __props__=None);
name string
The unique name of the resource.
args EventPermissionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args EventPermissionArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args EventPermissionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

EventPermission Resource Properties

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

Inputs

The EventPermission resource accepts the following input properties:

Principal string

The 12-digit AWS account ID that you are permitting to put events to your default event bus. Specify * to permit any account to put events to your default event bus, optionally limited by condition.

StatementId string

An identifier string for the external account that you are granting permissions to.

Action string

The action that you are enabling the other account to perform. Defaults to events:PutEvents.

Condition EventPermissionConditionArgs

Configuration block to limit the event bus permissions you are granting to only accounts that fulfill the condition. Specified below.

Principal string

The 12-digit AWS account ID that you are permitting to put events to your default event bus. Specify * to permit any account to put events to your default event bus, optionally limited by condition.

StatementId string

An identifier string for the external account that you are granting permissions to.

Action string

The action that you are enabling the other account to perform. Defaults to events:PutEvents.

Condition EventPermissionCondition

Configuration block to limit the event bus permissions you are granting to only accounts that fulfill the condition. Specified below.

principal string

The 12-digit AWS account ID that you are permitting to put events to your default event bus. Specify * to permit any account to put events to your default event bus, optionally limited by condition.

statementId string

An identifier string for the external account that you are granting permissions to.

action string

The action that you are enabling the other account to perform. Defaults to events:PutEvents.

condition EventPermissionCondition

Configuration block to limit the event bus permissions you are granting to only accounts that fulfill the condition. Specified below.

principal str

The 12-digit AWS account ID that you are permitting to put events to your default event bus. Specify * to permit any account to put events to your default event bus, optionally limited by condition.

statement_id str

An identifier string for the external account that you are granting permissions to.

action str

The action that you are enabling the other account to perform. Defaults to events:PutEvents.

condition Dict[EventPermissionCondition]

Configuration block to limit the event bus permissions you are granting to only accounts that fulfill the condition. Specified below.

Outputs

All input properties are implicitly available as output properties. Additionally, the EventPermission 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.

Look up an Existing EventPermission Resource

Get an existing EventPermission 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?: EventPermissionState, opts?: CustomResourceOptions): EventPermission
static get(resource_name, id, opts=None, action=None, condition=None, principal=None, statement_id=None, __props__=None);
func GetEventPermission(ctx *Context, name string, id IDInput, state *EventPermissionState, opts ...ResourceOption) (*EventPermission, error)
public static EventPermission Get(string name, Input<string> id, EventPermissionState? state, CustomResourceOptions? opts = null)
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.

The following state arguments are supported:

Action string

The action that you are enabling the other account to perform. Defaults to events:PutEvents.

Condition EventPermissionConditionArgs

Configuration block to limit the event bus permissions you are granting to only accounts that fulfill the condition. Specified below.

Principal string

The 12-digit AWS account ID that you are permitting to put events to your default event bus. Specify * to permit any account to put events to your default event bus, optionally limited by condition.

StatementId string

An identifier string for the external account that you are granting permissions to.

Action string

The action that you are enabling the other account to perform. Defaults to events:PutEvents.

Condition EventPermissionCondition

Configuration block to limit the event bus permissions you are granting to only accounts that fulfill the condition. Specified below.

Principal string

The 12-digit AWS account ID that you are permitting to put events to your default event bus. Specify * to permit any account to put events to your default event bus, optionally limited by condition.

StatementId string

An identifier string for the external account that you are granting permissions to.

action string

The action that you are enabling the other account to perform. Defaults to events:PutEvents.

condition EventPermissionCondition

Configuration block to limit the event bus permissions you are granting to only accounts that fulfill the condition. Specified below.

principal string

The 12-digit AWS account ID that you are permitting to put events to your default event bus. Specify * to permit any account to put events to your default event bus, optionally limited by condition.

statementId string

An identifier string for the external account that you are granting permissions to.

action str

The action that you are enabling the other account to perform. Defaults to events:PutEvents.

condition Dict[EventPermissionCondition]

Configuration block to limit the event bus permissions you are granting to only accounts that fulfill the condition. Specified below.

principal str

The 12-digit AWS account ID that you are permitting to put events to your default event bus. Specify * to permit any account to put events to your default event bus, optionally limited by condition.

statement_id str

An identifier string for the external account that you are granting permissions to.

Supporting Types

EventPermissionCondition

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

Key string

Key for the condition. Valid values: aws:PrincipalOrgID.

Type string

Type of condition. Value values: StringEquals.

Value string

Value for the key.

Key string

Key for the condition. Valid values: aws:PrincipalOrgID.

Type string

Type of condition. Value values: StringEquals.

Value string

Value for the key.

key string

Key for the condition. Valid values: aws:PrincipalOrgID.

type string

Type of condition. Value values: StringEquals.

value string

Value for the key.

key str

Key for the condition. Valid values: aws:PrincipalOrgID.

type str

Type of condition. Value values: StringEquals.

value str

Value for the key.

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.