1. Packages
  2. AWS Classic
  3. API Docs
  4. ses
  5. Template

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.31.1 published on Thursday, Apr 18, 2024 by Pulumi

aws.ses.Template

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.31.1 published on Thursday, Apr 18, 2024 by Pulumi

    Provides a resource to create a SES template.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const myTemplate = new aws.ses.Template("MyTemplate", {
        name: "MyTemplate",
        subject: "Greetings, {{name}}!",
        html: "<h1>Hello {{name}},</h1><p>Your favorite animal is {{favoriteanimal}}.</p>",
        text: `Hello {{name}},
    Your favorite animal is {{favoriteanimal}}.`,
    });
    
    import pulumi
    import pulumi_aws as aws
    
    my_template = aws.ses.Template("MyTemplate",
        name="MyTemplate",
        subject="Greetings, {{name}}!",
        html="<h1>Hello {{name}},</h1><p>Your favorite animal is {{favoriteanimal}}.</p>",
        text="""Hello {{name}},
    Your favorite animal is {{favoriteanimal}}.""")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ses"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ses.NewTemplate(ctx, "MyTemplate", &ses.TemplateArgs{
    			Name:    pulumi.String("MyTemplate"),
    			Subject: pulumi.String("Greetings, {{name}}!"),
    			Html:    pulumi.String("<h1>Hello {{name}},</h1><p>Your favorite animal is {{favoriteanimal}}.</p>"),
    			Text:    pulumi.String("Hello {{name}},
    \nYour favorite animal is {{favoriteanimal}}."),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var myTemplate = new Aws.Ses.Template("MyTemplate", new()
        {
            Name = "MyTemplate",
            Subject = "Greetings, {{name}}!",
            Html = "<h1>Hello {{name}},</h1><p>Your favorite animal is {{favoriteanimal}}.</p>",
            Text = @"Hello {{name}},
    Your favorite animal is {{favoriteanimal}}.",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.ses.Template;
    import com.pulumi.aws.ses.TemplateArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var myTemplate = new Template("myTemplate", TemplateArgs.builder()        
                .name("MyTemplate")
                .subject("Greetings, {{name}}!")
                .html("<h1>Hello {{name}},</h1><p>Your favorite animal is {{favoriteanimal}}.</p>")
                .text("""
    Hello {{name}},
    Your favorite animal is {{favoriteanimal}}.            """)
                .build());
    
        }
    }
    
    resources:
      myTemplate:
        type: aws:ses:Template
        name: MyTemplate
        properties:
          name: MyTemplate
          subject: Greetings, {{name}}!
          html: <h1>Hello {{name}},</h1><p>Your favorite animal is {{favoriteanimal}}.</p>
          text: "Hello {{name}},\r\nYour favorite animal is {{favoriteanimal}}."
    

    Create Template Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new Template(name: string, args?: TemplateArgs, opts?: CustomResourceOptions);
    @overload
    def Template(resource_name: str,
                 args: Optional[TemplateArgs] = None,
                 opts: Optional[ResourceOptions] = None)
    
    @overload
    def Template(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 html: Optional[str] = None,
                 name: Optional[str] = None,
                 subject: Optional[str] = None,
                 text: Optional[str] = None)
    func NewTemplate(ctx *Context, name string, args *TemplateArgs, opts ...ResourceOption) (*Template, error)
    public Template(string name, TemplateArgs? args = null, CustomResourceOptions? opts = null)
    public Template(String name, TemplateArgs args)
    public Template(String name, TemplateArgs args, CustomResourceOptions options)
    
    type: aws:ses:Template
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args TemplateArgs
    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 TemplateArgs
    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 TemplateArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args TemplateArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args TemplateArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

    The following reference example uses placeholder values for all input properties.

    var exampletemplateResourceResourceFromSestemplate = new Aws.Ses.Template("exampletemplateResourceResourceFromSestemplate", new()
    {
        Html = "string",
        Name = "string",
        Subject = "string",
        Text = "string",
    });
    
    example, err := ses.NewTemplate(ctx, "exampletemplateResourceResourceFromSestemplate", &ses.TemplateArgs{
    	Html:    pulumi.String("string"),
    	Name:    pulumi.String("string"),
    	Subject: pulumi.String("string"),
    	Text:    pulumi.String("string"),
    })
    
    var exampletemplateResourceResourceFromSestemplate = new Template("exampletemplateResourceResourceFromSestemplate", TemplateArgs.builder()        
        .html("string")
        .name("string")
        .subject("string")
        .text("string")
        .build());
    
    exampletemplate_resource_resource_from_sestemplate = aws.ses.Template("exampletemplateResourceResourceFromSestemplate",
        html="string",
        name="string",
        subject="string",
        text="string")
    
    const exampletemplateResourceResourceFromSestemplate = new aws.ses.Template("exampletemplateResourceResourceFromSestemplate", {
        html: "string",
        name: "string",
        subject: "string",
        text: "string",
    });
    
    type: aws:ses:Template
    properties:
        html: string
        name: string
        subject: string
        text: string
    

    Template 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 Template resource accepts the following input properties:

    Html string
    The HTML body of the email. Must be less than 500KB in size, including both the text and HTML parts.
    Name string
    The name of the template. Cannot exceed 64 characters. You will refer to this name when you send email.
    Subject string
    The subject line of the email.
    Text string
    The email body that will be visible to recipients whose email clients do not display HTML. Must be less than 500KB in size, including both the text and HTML parts.
    Html string
    The HTML body of the email. Must be less than 500KB in size, including both the text and HTML parts.
    Name string
    The name of the template. Cannot exceed 64 characters. You will refer to this name when you send email.
    Subject string
    The subject line of the email.
    Text string
    The email body that will be visible to recipients whose email clients do not display HTML. Must be less than 500KB in size, including both the text and HTML parts.
    html String
    The HTML body of the email. Must be less than 500KB in size, including both the text and HTML parts.
    name String
    The name of the template. Cannot exceed 64 characters. You will refer to this name when you send email.
    subject String
    The subject line of the email.
    text String
    The email body that will be visible to recipients whose email clients do not display HTML. Must be less than 500KB in size, including both the text and HTML parts.
    html string
    The HTML body of the email. Must be less than 500KB in size, including both the text and HTML parts.
    name string
    The name of the template. Cannot exceed 64 characters. You will refer to this name when you send email.
    subject string
    The subject line of the email.
    text string
    The email body that will be visible to recipients whose email clients do not display HTML. Must be less than 500KB in size, including both the text and HTML parts.
    html str
    The HTML body of the email. Must be less than 500KB in size, including both the text and HTML parts.
    name str
    The name of the template. Cannot exceed 64 characters. You will refer to this name when you send email.
    subject str
    The subject line of the email.
    text str
    The email body that will be visible to recipients whose email clients do not display HTML. Must be less than 500KB in size, including both the text and HTML parts.
    html String
    The HTML body of the email. Must be less than 500KB in size, including both the text and HTML parts.
    name String
    The name of the template. Cannot exceed 64 characters. You will refer to this name when you send email.
    subject String
    The subject line of the email.
    text String
    The email body that will be visible to recipients whose email clients do not display HTML. Must be less than 500KB in size, including both the text and HTML parts.

    Outputs

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

    Arn string
    The ARN of the SES template
    Id string
    The provider-assigned unique ID for this managed resource.
    Arn string
    The ARN of the SES template
    Id string
    The provider-assigned unique ID for this managed resource.
    arn String
    The ARN of the SES template
    id String
    The provider-assigned unique ID for this managed resource.
    arn string
    The ARN of the SES template
    id string
    The provider-assigned unique ID for this managed resource.
    arn str
    The ARN of the SES template
    id str
    The provider-assigned unique ID for this managed resource.
    arn String
    The ARN of the SES template
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing Template Resource

    Get an existing Template 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?: TemplateState, opts?: CustomResourceOptions): Template
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            arn: Optional[str] = None,
            html: Optional[str] = None,
            name: Optional[str] = None,
            subject: Optional[str] = None,
            text: Optional[str] = None) -> Template
    func GetTemplate(ctx *Context, name string, id IDInput, state *TemplateState, opts ...ResourceOption) (*Template, error)
    public static Template Get(string name, Input<string> id, TemplateState? state, CustomResourceOptions? opts = null)
    public static Template get(String name, Output<String> id, TemplateState 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:
    Arn string
    The ARN of the SES template
    Html string
    The HTML body of the email. Must be less than 500KB in size, including both the text and HTML parts.
    Name string
    The name of the template. Cannot exceed 64 characters. You will refer to this name when you send email.
    Subject string
    The subject line of the email.
    Text string
    The email body that will be visible to recipients whose email clients do not display HTML. Must be less than 500KB in size, including both the text and HTML parts.
    Arn string
    The ARN of the SES template
    Html string
    The HTML body of the email. Must be less than 500KB in size, including both the text and HTML parts.
    Name string
    The name of the template. Cannot exceed 64 characters. You will refer to this name when you send email.
    Subject string
    The subject line of the email.
    Text string
    The email body that will be visible to recipients whose email clients do not display HTML. Must be less than 500KB in size, including both the text and HTML parts.
    arn String
    The ARN of the SES template
    html String
    The HTML body of the email. Must be less than 500KB in size, including both the text and HTML parts.
    name String
    The name of the template. Cannot exceed 64 characters. You will refer to this name when you send email.
    subject String
    The subject line of the email.
    text String
    The email body that will be visible to recipients whose email clients do not display HTML. Must be less than 500KB in size, including both the text and HTML parts.
    arn string
    The ARN of the SES template
    html string
    The HTML body of the email. Must be less than 500KB in size, including both the text and HTML parts.
    name string
    The name of the template. Cannot exceed 64 characters. You will refer to this name when you send email.
    subject string
    The subject line of the email.
    text string
    The email body that will be visible to recipients whose email clients do not display HTML. Must be less than 500KB in size, including both the text and HTML parts.
    arn str
    The ARN of the SES template
    html str
    The HTML body of the email. Must be less than 500KB in size, including both the text and HTML parts.
    name str
    The name of the template. Cannot exceed 64 characters. You will refer to this name when you send email.
    subject str
    The subject line of the email.
    text str
    The email body that will be visible to recipients whose email clients do not display HTML. Must be less than 500KB in size, including both the text and HTML parts.
    arn String
    The ARN of the SES template
    html String
    The HTML body of the email. Must be less than 500KB in size, including both the text and HTML parts.
    name String
    The name of the template. Cannot exceed 64 characters. You will refer to this name when you send email.
    subject String
    The subject line of the email.
    text String
    The email body that will be visible to recipients whose email clients do not display HTML. Must be less than 500KB in size, including both the text and HTML parts.

    Import

    Using pulumi import, import SES templates using the template name. For example:

    $ pulumi import aws:ses/template:Template MyTemplate MyTemplate
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.31.1 published on Thursday, Apr 18, 2024 by Pulumi