EmailChannel

Provides a Pinpoint Email Channel resource.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var app = new Aws.Pinpoint.App("app", new Aws.Pinpoint.AppArgs
        {
        });
        var identity = new Aws.Ses.DomainIdentity("identity", new Aws.Ses.DomainIdentityArgs
        {
            Domain = "example.com",
        });
        var role = new Aws.Iam.Role("role", new Aws.Iam.RoleArgs
        {
            AssumeRolePolicy = @"{
  ""Version"": ""2012-10-17"",
  ""Statement"": [
    {
      ""Action"": ""sts:AssumeRole"",
      ""Principal"": {
        ""Service"": ""pinpoint.amazonaws.com""
      },
      ""Effect"": ""Allow"",
      ""Sid"": """"
    }
  ]
}

",
        });
        var email = new Aws.Pinpoint.EmailChannel("email", new Aws.Pinpoint.EmailChannelArgs
        {
            ApplicationId = app.ApplicationId,
            FromAddress = "user@example.com",
            Identity = identity.Arn,
            RoleArn = role.Arn,
        });
        var rolePolicy = new Aws.Iam.RolePolicy("rolePolicy", new Aws.Iam.RolePolicyArgs
        {
            Policy = @"{
  ""Version"": ""2012-10-17"",
  ""Statement"": {
    ""Action"": [
      ""mobileanalytics:PutEvents"",
      ""mobileanalytics:PutItems""
    ],
    ""Effect"": ""Allow"",
    ""Resource"": [
      ""*""
    ]
  }
}

",
            Role = role.Id,
        });
    }

}
package main

import (
    "fmt"

    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws/iam"
    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws/pinpoint"
    "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 {
        app, err := pinpoint.NewApp(ctx, "app", nil)
        if err != nil {
            return err
        }
        identity, err := ses.NewDomainIdentity(ctx, "identity", &ses.DomainIdentityArgs{
            Domain: pulumi.String("example.com"),
        })
        if err != nil {
            return err
        }
        role, err := iam.NewRole(ctx, "role", &iam.RoleArgs{
            AssumeRolePolicy: pulumi.String(fmt.Sprintf("%v%v%v%v%v%v%v%v%v%v%v%v%v%v", "{\n", "  \"Version\": \"2012-10-17\",\n", "  \"Statement\": [\n", "    {\n", "      \"Action\": \"sts:AssumeRole\",\n", "      \"Principal\": {\n", "        \"Service\": \"pinpoint.amazonaws.com\"\n", "      },\n", "      \"Effect\": \"Allow\",\n", "      \"Sid\": \"\"\n", "    }\n", "  ]\n", "}\n", "\n")),
        })
        if err != nil {
            return err
        }
        _, err = pinpoint.NewEmailChannel(ctx, "email", &pinpoint.EmailChannelArgs{
            ApplicationId: app.ApplicationId,
            FromAddress:   pulumi.String("user@example.com"),
            Identity:      identity.Arn,
            RoleArn:       role.Arn,
        })
        if err != nil {
            return err
        }
        _, err = iam.NewRolePolicy(ctx, "rolePolicy", &iam.RolePolicyArgs{
            Policy: pulumi.String(fmt.Sprintf("%v%v%v%v%v%v%v%v%v%v%v%v%v%v", "{\n", "  \"Version\": \"2012-10-17\",\n", "  \"Statement\": {\n", "    \"Action\": [\n", "      \"mobileanalytics:PutEvents\",\n", "      \"mobileanalytics:PutItems\"\n", "    ],\n", "    \"Effect\": \"Allow\",\n", "    \"Resource\": [\n", "      \"*\"\n", "    ]\n", "  }\n", "}\n", "\n")),
            Role:   role.ID(),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_aws as aws

app = aws.pinpoint.App("app")
identity = aws.ses.DomainIdentity("identity", domain="example.com")
role = aws.iam.Role("role", assume_role_policy="""{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Action": "sts:AssumeRole",
      "Principal": {
        "Service": "pinpoint.amazonaws.com"
      },
      "Effect": "Allow",
      "Sid": ""
    }
  ]
}

""")
email = aws.pinpoint.EmailChannel("email",
    application_id=app.application_id,
    from_address="user@example.com",
    identity=identity.arn,
    role_arn=role.arn)
role_policy = aws.iam.RolePolicy("rolePolicy",
    policy="""{
  "Version": "2012-10-17",
  "Statement": {
    "Action": [
      "mobileanalytics:PutEvents",
      "mobileanalytics:PutItems"
    ],
    "Effect": "Allow",
    "Resource": [
      "*"
    ]
  }
}

""",
    role=role.id)
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const app = new aws.pinpoint.App("app", {});
const identity = new aws.ses.DomainIdentity("identity", {
    domain: "example.com",
});
const role = new aws.iam.Role("role", {
    assumeRolePolicy: `{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Action": "sts:AssumeRole",
      "Principal": {
        "Service": "pinpoint.amazonaws.com"
      },
      "Effect": "Allow",
      "Sid": ""
    }
  ]
}
`,
});
const email = new aws.pinpoint.EmailChannel("email", {
    applicationId: app.applicationId,
    fromAddress: "user@example.com",
    identity: identity.arn,
    roleArn: role.arn,
});
const rolePolicy = new aws.iam.RolePolicy("role_policy", {
    policy: `{
  "Version": "2012-10-17",
  "Statement": {
    "Action": [
      "mobileanalytics:PutEvents",
      "mobileanalytics:PutItems"
    ],
    "Effect": "Allow",
    "Resource": [
      "*"
    ]
  }
}
`,
    role: role.id,
});

Create a EmailChannel Resource

def EmailChannel(resource_name, opts=None, application_id=None, enabled=None, from_address=None, identity=None, role_arn=None, __props__=None);
func NewEmailChannel(ctx *Context, name string, args EmailChannelArgs, opts ...ResourceOption) (*EmailChannel, error)
name string
The unique name of the resource.
args EmailChannelArgs
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 EmailChannelArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args EmailChannelArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

EmailChannel Resource Properties

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

Inputs

The EmailChannel resource accepts the following input properties:

ApplicationId string

The application ID.

FromAddress string

The email address used to send emails from.

Identity string

The ARN of an identity verified with SES.

RoleArn string

The ARN of an IAM Role used to submit events to Mobile Analytics’ event ingestion service.

Enabled bool

Whether the channel is enabled or disabled. Defaults to true.

ApplicationId string

The application ID.

FromAddress string

The email address used to send emails from.

Identity string

The ARN of an identity verified with SES.

RoleArn string

The ARN of an IAM Role used to submit events to Mobile Analytics’ event ingestion service.

Enabled bool

Whether the channel is enabled or disabled. Defaults to true.

applicationId string

The application ID.

fromAddress string

The email address used to send emails from.

identity string

The ARN of an identity verified with SES.

roleArn string

The ARN of an IAM Role used to submit events to Mobile Analytics’ event ingestion service.

enabled boolean

Whether the channel is enabled or disabled. Defaults to true.

application_id str

The application ID.

from_address str

The email address used to send emails from.

identity str

The ARN of an identity verified with SES.

role_arn str

The ARN of an IAM Role used to submit events to Mobile Analytics’ event ingestion service.

enabled bool

Whether the channel is enabled or disabled. Defaults to true.

Outputs

All input properties are implicitly available as output properties. Additionally, the EmailChannel resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
MessagesPerSecond int

Messages per second that can be sent.

Id string
The provider-assigned unique ID for this managed resource.
MessagesPerSecond int

Messages per second that can be sent.

id string
The provider-assigned unique ID for this managed resource.
messagesPerSecond number

Messages per second that can be sent.

id str
The provider-assigned unique ID for this managed resource.
messages_per_second float

Messages per second that can be sent.

Look up an Existing EmailChannel Resource

Get an existing EmailChannel 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?: EmailChannelState, opts?: CustomResourceOptions): EmailChannel
static get(resource_name, id, opts=None, application_id=None, enabled=None, from_address=None, identity=None, messages_per_second=None, role_arn=None, __props__=None);
func GetEmailChannel(ctx *Context, name string, id IDInput, state *EmailChannelState, opts ...ResourceOption) (*EmailChannel, error)
public static EmailChannel Get(string name, Input<string> id, EmailChannelState? 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:

ApplicationId string

The application ID.

Enabled bool

Whether the channel is enabled or disabled. Defaults to true.

FromAddress string

The email address used to send emails from.

Identity string

The ARN of an identity verified with SES.

MessagesPerSecond int

Messages per second that can be sent.

RoleArn string

The ARN of an IAM Role used to submit events to Mobile Analytics’ event ingestion service.

ApplicationId string

The application ID.

Enabled bool

Whether the channel is enabled or disabled. Defaults to true.

FromAddress string

The email address used to send emails from.

Identity string

The ARN of an identity verified with SES.

MessagesPerSecond int

Messages per second that can be sent.

RoleArn string

The ARN of an IAM Role used to submit events to Mobile Analytics’ event ingestion service.

applicationId string

The application ID.

enabled boolean

Whether the channel is enabled or disabled. Defaults to true.

fromAddress string

The email address used to send emails from.

identity string

The ARN of an identity verified with SES.

messagesPerSecond number

Messages per second that can be sent.

roleArn string

The ARN of an IAM Role used to submit events to Mobile Analytics’ event ingestion service.

application_id str

The application ID.

enabled bool

Whether the channel is enabled or disabled. Defaults to true.

from_address str

The email address used to send emails from.

identity str

The ARN of an identity verified with SES.

messages_per_second float

Messages per second that can be sent.

role_arn str

The ARN of an IAM Role used to submit events to Mobile Analytics’ event ingestion service.

Package Details

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