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
new EventPermission(name: string, args: EventPermissionArgs, opts?: CustomResourceOptions);def EventPermission(resource_name, opts=None, action=None, condition=None, principal=None, statement_id=None, __props__=None);func NewEventPermission(ctx *Context, name string, args EventPermissionArgs, opts ...ResourceOption) (*EventPermission, error)public EventPermission(string name, EventPermissionArgs args, CustomResourceOptions? opts = null)- 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 bycondition.- Statement
Id 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
Event
Permission Condition Args 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 bycondition.- Statement
Id 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
Event
Permission Condition 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 bycondition.- statement
Id 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
Event
Permission Condition 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 bycondition.- 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[Event
Permission Condition] 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:
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): EventPermissionstatic 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
Event
Permission Condition Args 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 bycondition.- Statement
Id 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
Event
Permission Condition 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 bycondition.- Statement
Id 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
Event
Permission Condition 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 bycondition.- statement
Id 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[Event
Permission Condition] 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 bycondition.- statement_
id str An identifier string for the external account that you are granting permissions to.
Supporting Types
EventPermissionCondition
Package Details
- Repository
- https://github.com/pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
awsTerraform Provider.