AWS Classic

Pulumi Official
Package maintained by Pulumi
v5.10.0 published on Monday, Jul 11, 2022 by Pulumi

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 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",
            RoleArn = role.Arn,
        });
        var identity = new Aws.Ses.DomainIdentity("identity", new Aws.Ses.DomainIdentityArgs
        {
            Domain = "example.com",
        });
        var rolePolicy = new Aws.Iam.RolePolicy("rolePolicy", new Aws.Iam.RolePolicyArgs
        {
            Role = role.Id,
            Policy = @"{
  ""Version"": ""2012-10-17"",
  ""Statement"": {
    ""Action"": [
      ""mobileanalytics:PutEvents"",
      ""mobileanalytics:PutItems""
    ],
    ""Effect"": ""Allow"",
    ""Resource"": [
      ""*""
    ]
  }
}
",
        });
    }

}
package main

import (
	"fmt"

	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/iam"
	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/pinpoint"
	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/ses"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		app, err := pinpoint.NewApp(ctx, "app", nil)
		if err != nil {
			return err
		}
		role, err := iam.NewRole(ctx, "role", &iam.RoleArgs{
			AssumeRolePolicy: pulumi.Any(fmt.Sprintf("%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")),
		})
		if err != nil {
			return err
		}
		_, err = pinpoint.NewEmailChannel(ctx, "email", &pinpoint.EmailChannelArgs{
			ApplicationId: app.ApplicationId,
			FromAddress:   pulumi.String("user@example.com"),
			RoleArn:       role.Arn,
		})
		if err != nil {
			return err
		}
		_, err = ses.NewDomainIdentity(ctx, "identity", &ses.DomainIdentityArgs{
			Domain: pulumi.String("example.com"),
		})
		if err != nil {
			return err
		}
		_, err = iam.NewRolePolicy(ctx, "rolePolicy", &iam.RolePolicyArgs{
			Role:   role.ID(),
			Policy: pulumi.Any(fmt.Sprintf("%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")),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var app = new App("app");

        var role = new Role("role", RoleArgs.builder()        
            .assumeRolePolicy("""
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Action": "sts:AssumeRole",
      "Principal": {
        "Service": "pinpoint.amazonaws.com"
      },
      "Effect": "Allow",
      "Sid": ""
    }
  ]
}
            """)
            .build());

        var email = new EmailChannel("email", EmailChannelArgs.builder()        
            .applicationId(app.applicationId())
            .fromAddress("user@example.com")
            .roleArn(role.arn())
            .build());

        var identity = new DomainIdentity("identity", DomainIdentityArgs.builder()        
            .domain("example.com")
            .build());

        var rolePolicy = new RolePolicy("rolePolicy", RolePolicyArgs.builder()        
            .role(role.id())
            .policy("""
{
  "Version": "2012-10-17",
  "Statement": {
    "Action": [
      "mobileanalytics:PutEvents",
      "mobileanalytics:PutItems"
    ],
    "Effect": "Allow",
    "Resource": [
      "*"
    ]
  }
}
            """)
            .build());

    }
}
import pulumi
import pulumi_aws as aws

app = aws.pinpoint.App("app")
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",
    role_arn=role.arn)
identity = aws.ses.DomainIdentity("identity", domain="example.com")
role_policy = aws.iam.RolePolicy("rolePolicy",
    role=role.id,
    policy="""{
  "Version": "2012-10-17",
  "Statement": {
    "Action": [
      "mobileanalytics:PutEvents",
      "mobileanalytics:PutItems"
    ],
    "Effect": "Allow",
    "Resource": [
      "*"
    ]
  }
}
""")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

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

Create a EmailChannel Resource

new EmailChannel(name: string, args: EmailChannelArgs, opts?: CustomResourceOptions);
@overload
def EmailChannel(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 application_id: Optional[str] = None,
                 configuration_set: Optional[str] = None,
                 enabled: Optional[bool] = None,
                 from_address: Optional[str] = None,
                 identity: Optional[str] = None,
                 role_arn: Optional[str] = None)
@overload
def EmailChannel(resource_name: str,
                 args: EmailChannelArgs,
                 opts: Optional[ResourceOptions] = None)
func NewEmailChannel(ctx *Context, name string, args EmailChannelArgs, opts ...ResourceOption) (*EmailChannel, error)
public EmailChannel(string name, EmailChannelArgs args, CustomResourceOptions? opts = null)
public EmailChannel(String name, EmailChannelArgs args)
public EmailChannel(String name, EmailChannelArgs args, CustomResourceOptions options)
type: aws:pinpoint:EmailChannel
properties: # The arguments to resource properties.
options: # 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.
resource_name str
The unique name of the resource.
args EmailChannelArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control 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.
name String
The unique name of the resource.
args EmailChannelArgs
The arguments to resource properties.
options 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 Architecture and Concepts 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. You can use email only (user@example.com) or friendly address (User <user@example.com>). This field comply with RFC 5322.

Identity string

The ARN of an identity verified with SES.

ConfigurationSet string

The ARN of the Amazon SES configuration set that you want to apply to messages that you send through the channel.

Enabled bool

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

RoleArn string

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

ApplicationId string

The application ID.

FromAddress string

The email address used to send emails from. You can use email only (user@example.com) or friendly address (User <user@example.com>). This field comply with RFC 5322.

Identity string

The ARN of an identity verified with SES.

ConfigurationSet string

The ARN of the Amazon SES configuration set that you want to apply to messages that you send through the channel.

Enabled bool

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

RoleArn string

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

applicationId String

The application ID.

fromAddress String

The email address used to send emails from. You can use email only (user@example.com) or friendly address (User <user@example.com>). This field comply with RFC 5322.

identity String

The ARN of an identity verified with SES.

configurationSet String

The ARN of the Amazon SES configuration set that you want to apply to messages that you send through the channel.

enabled Boolean

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

roleArn String

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

applicationId string

The application ID.

fromAddress string

The email address used to send emails from. You can use email only (user@example.com) or friendly address (User <user@example.com>). This field comply with RFC 5322.

identity string

The ARN of an identity verified with SES.

configurationSet string

The ARN of the Amazon SES configuration set that you want to apply to messages that you send through the channel.

enabled boolean

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

roleArn string

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

application_id str

The application ID.

from_address str

The email address used to send emails from. You can use email only (user@example.com) or friendly address (User <user@example.com>). This field comply with RFC 5322.

identity str

The ARN of an identity verified with SES.

configuration_set str

The ARN of the Amazon SES configuration set that you want to apply to messages that you send through the channel.

enabled bool

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

role_arn str

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

applicationId String

The application ID.

fromAddress String

The email address used to send emails from. You can use email only (user@example.com) or friendly address (User <user@example.com>). This field comply with RFC 5322.

identity String

The ARN of an identity verified with SES.

configurationSet String

The ARN of the Amazon SES configuration set that you want to apply to messages that you send through the channel.

enabled Boolean

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

roleArn String

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

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 Integer

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 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.

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
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        application_id: Optional[str] = None,
        configuration_set: Optional[str] = None,
        enabled: Optional[bool] = None,
        from_address: Optional[str] = None,
        identity: Optional[str] = None,
        messages_per_second: Optional[int] = None,
        role_arn: Optional[str] = None) -> EmailChannel
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)
public static EmailChannel get(String name, Output<String> id, EmailChannelState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
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.
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.

ConfigurationSet string

The ARN of the Amazon SES configuration set that you want to apply to messages that you send through the channel.

Enabled bool

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

FromAddress string

The email address used to send emails from. You can use email only (user@example.com) or friendly address (User <user@example.com>). This field comply with RFC 5322.

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.

ConfigurationSet string

The ARN of the Amazon SES configuration set that you want to apply to messages that you send through the channel.

Enabled bool

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

FromAddress string

The email address used to send emails from. You can use email only (user@example.com) or friendly address (User <user@example.com>). This field comply with RFC 5322.

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.

configurationSet String

The ARN of the Amazon SES configuration set that you want to apply to messages that you send through the channel.

enabled Boolean

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

fromAddress String

The email address used to send emails from. You can use email only (user@example.com) or friendly address (User <user@example.com>). This field comply with RFC 5322.

identity String

The ARN of an identity verified with SES.

messagesPerSecond Integer

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.

configurationSet string

The ARN of the Amazon SES configuration set that you want to apply to messages that you send through the channel.

enabled boolean

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

fromAddress string

The email address used to send emails from. You can use email only (user@example.com) or friendly address (User <user@example.com>). This field comply with RFC 5322.

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.

configuration_set str

The ARN of the Amazon SES configuration set that you want to apply to messages that you send through the channel.

enabled bool

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

from_address str

The email address used to send emails from. You can use email only (user@example.com) or friendly address (User <user@example.com>). This field comply with RFC 5322.

identity str

The ARN of an identity verified with SES.

messages_per_second int

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.

applicationId String

The application ID.

configurationSet String

The ARN of the Amazon SES configuration set that you want to apply to messages that you send through the channel.

enabled Boolean

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

fromAddress String

The email address used to send emails from. You can use email only (user@example.com) or friendly address (User <user@example.com>). This field comply with RFC 5322.

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.

Import

Pinpoint Email Channel can be imported using the application-id, e.g.,

 $ pulumi import aws:pinpoint/emailChannel:EmailChannel email application-id

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.