IdentityPolicy

Manages a SES Identity Policy. More information about SES Sending Authorization Policies can be found in the SES Developer Guide.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var exampleDomainIdentity = new Aws.Ses.DomainIdentity("exampleDomainIdentity", new Aws.Ses.DomainIdentityArgs
        {
            Domain = "example.com",
        });
        var examplePolicyDocument = exampleDomainIdentity.Arn.Apply(arn => Aws.Iam.GetPolicyDocument.InvokeAsync(new Aws.Iam.GetPolicyDocumentArgs
        {
            Statements = 
            {
                new Aws.Iam.Inputs.GetPolicyDocumentStatementArgs
                {
                    Actions = 
                    {
                        "SES:SendEmail",
                        "SES:SendRawEmail",
                    },
                    Principals = 
                    {
                        new Aws.Iam.Inputs.GetPolicyDocumentStatementPrincipalArgs
                        {
                            Identifiers = 
                            {
                                "*",
                            },
                            Type = "AWS",
                        },
                    },
                    Resources = 
                    {
                        arn,
                    },
                },
            },
        }));
        var exampleIdentityPolicy = new Aws.Ses.IdentityPolicy("exampleIdentityPolicy", new Aws.Ses.IdentityPolicyArgs
        {
            Identity = exampleDomainIdentity.Arn,
            Policy = examplePolicyDocument.Apply(examplePolicyDocument => examplePolicyDocument.Json),
        });
    }

}
package main

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

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        exampleDomainIdentity, err := ses.NewDomainIdentity(ctx, "exampleDomainIdentity", &ses.DomainIdentityArgs{
            Domain: pulumi.String("example.com"),
        })
        if err != nil {
            return err
        }
        _, err = ses.NewIdentityPolicy(ctx, "exampleIdentityPolicy", &ses.IdentityPolicyArgs{
            Identity: exampleDomainIdentity.Arn,
            Policy: examplePolicyDocument.ApplyT(func(examplePolicyDocument iam.GetPolicyDocumentResult) (string, error) {
                return examplePolicyDocument.Json, nil
            }).(pulumi.StringOutput),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_aws as aws

example_domain_identity = aws.ses.DomainIdentity("exampleDomainIdentity", domain="example.com")
example_policy_document = example_domain_identity.arn.apply(lambda arn: aws.iam.get_policy_document(statements=[{
    "actions": [
        "SES:SendEmail",
        "SES:SendRawEmail",
    ],
    "principals": [{
        "identifiers": ["*"],
        "type": "AWS",
    }],
    "resources": [arn],
}]))
example_identity_policy = aws.ses.IdentityPolicy("exampleIdentityPolicy",
    identity=example_domain_identity.arn,
    policy=example_policy_document.json)
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const exampleDomainIdentity = new aws.ses.DomainIdentity("example", {
    domain: "example.com",
});
const examplePolicyDocument = exampleDomainIdentity.arn.apply(arn => aws.iam.getPolicyDocument({
    statements: [{
        actions: [
            "SES:SendEmail",
            "SES:SendRawEmail",
        ],
        principals: [{
            identifiers: ["*"],
            type: "AWS",
        }],
        resources: [arn],
    }],
}, { async: true }));
const exampleIdentityPolicy = new aws.ses.IdentityPolicy("example", {
    identity: exampleDomainIdentity.arn,
    policy: examplePolicyDocument.json,
});

Create a IdentityPolicy Resource

def IdentityPolicy(resource_name, opts=None, identity=None, name=None, policy=None, __props__=None);
name string
The unique name of the resource.
args IdentityPolicyArgs
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 IdentityPolicyArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args IdentityPolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

IdentityPolicy Resource Properties

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

Inputs

The IdentityPolicy resource accepts the following input properties:

Identity string

Name or Amazon Resource Name (ARN) of the SES Identity.

Policy string

JSON string of the policy.

Name string

Name of the policy.

Identity string

Name or Amazon Resource Name (ARN) of the SES Identity.

Policy string

JSON string of the policy.

Name string

Name of the policy.

identity string

Name or Amazon Resource Name (ARN) of the SES Identity.

policy string

JSON string of the policy.

name string

Name of the policy.

identity str

Name or Amazon Resource Name (ARN) of the SES Identity.

policy str

JSON string of the policy.

name str

Name of the policy.

Outputs

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

Get an existing IdentityPolicy 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?: IdentityPolicyState, opts?: CustomResourceOptions): IdentityPolicy
static get(resource_name, id, opts=None, identity=None, name=None, policy=None, __props__=None);
func GetIdentityPolicy(ctx *Context, name string, id IDInput, state *IdentityPolicyState, opts ...ResourceOption) (*IdentityPolicy, error)
public static IdentityPolicy Get(string name, Input<string> id, IdentityPolicyState? 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:

Identity string

Name or Amazon Resource Name (ARN) of the SES Identity.

Name string

Name of the policy.

Policy string

JSON string of the policy.

Identity string

Name or Amazon Resource Name (ARN) of the SES Identity.

Name string

Name of the policy.

Policy string

JSON string of the policy.

identity string

Name or Amazon Resource Name (ARN) of the SES Identity.

name string

Name of the policy.

policy string

JSON string of the policy.

identity str

Name or Amazon Resource Name (ARN) of the SES Identity.

name str

Name of the policy.

policy str

JSON string of the policy.

Package Details

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