aws.ses.IdentityPolicy
Explore with Pulumi AI
Manages a SES Identity Policy. More information about SES Sending Authorization Policies can be found in the SES Developer Guide.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const exampleDomainIdentity = new aws.ses.DomainIdentity("example", {domain: "example.com"});
const example = aws.iam.getPolicyDocumentOutput({
statements: [{
actions: [
"SES:SendEmail",
"SES:SendRawEmail",
],
resources: [exampleDomainIdentity.arn],
principals: [{
identifiers: ["*"],
type: "AWS",
}],
}],
});
const exampleIdentityPolicy = new aws.ses.IdentityPolicy("example", {
identity: exampleDomainIdentity.arn,
name: "example",
policy: example.apply(example => example.json),
});
import pulumi
import pulumi_aws as aws
example_domain_identity = aws.ses.DomainIdentity("example", domain="example.com")
example = aws.iam.get_policy_document_output(statements=[{
"actions": [
"SES:SendEmail",
"SES:SendRawEmail",
],
"resources": [example_domain_identity.arn],
"principals": [{
"identifiers": ["*"],
"type": "AWS",
}],
}])
example_identity_policy = aws.ses.IdentityPolicy("example",
identity=example_domain_identity.arn,
name="example",
policy=example.json)
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iam"
"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 {
exampleDomainIdentity, err := ses.NewDomainIdentity(ctx, "example", &ses.DomainIdentityArgs{
Domain: pulumi.String("example.com"),
})
if err != nil {
return err
}
example := iam.GetPolicyDocumentOutput(ctx, iam.GetPolicyDocumentOutputArgs{
Statements: iam.GetPolicyDocumentStatementArray{
&iam.GetPolicyDocumentStatementArgs{
Actions: pulumi.StringArray{
pulumi.String("SES:SendEmail"),
pulumi.String("SES:SendRawEmail"),
},
Resources: pulumi.StringArray{
exampleDomainIdentity.Arn,
},
Principals: iam.GetPolicyDocumentStatementPrincipalArray{
&iam.GetPolicyDocumentStatementPrincipalArgs{
Identifiers: pulumi.StringArray{
pulumi.String("*"),
},
Type: pulumi.String("AWS"),
},
},
},
},
}, nil)
_, err = ses.NewIdentityPolicy(ctx, "example", &ses.IdentityPolicyArgs{
Identity: exampleDomainIdentity.Arn,
Name: pulumi.String("example"),
Policy: pulumi.String(example.ApplyT(func(example iam.GetPolicyDocumentResult) (*string, error) {
return &example.Json, nil
}).(pulumi.StringPtrOutput)),
})
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 exampleDomainIdentity = new Aws.Ses.DomainIdentity("example", new()
{
Domain = "example.com",
});
var example = Aws.Iam.GetPolicyDocument.Invoke(new()
{
Statements = new[]
{
new Aws.Iam.Inputs.GetPolicyDocumentStatementInputArgs
{
Actions = new[]
{
"SES:SendEmail",
"SES:SendRawEmail",
},
Resources = new[]
{
exampleDomainIdentity.Arn,
},
Principals = new[]
{
new Aws.Iam.Inputs.GetPolicyDocumentStatementPrincipalInputArgs
{
Identifiers = new[]
{
"*",
},
Type = "AWS",
},
},
},
},
});
var exampleIdentityPolicy = new Aws.Ses.IdentityPolicy("example", new()
{
Identity = exampleDomainIdentity.Arn,
Name = "example",
Policy = example.Apply(getPolicyDocumentResult => getPolicyDocumentResult.Json),
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ses.DomainIdentity;
import com.pulumi.aws.ses.DomainIdentityArgs;
import com.pulumi.aws.iam.IamFunctions;
import com.pulumi.aws.iam.inputs.GetPolicyDocumentArgs;
import com.pulumi.aws.ses.IdentityPolicy;
import com.pulumi.aws.ses.IdentityPolicyArgs;
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 exampleDomainIdentity = new DomainIdentity("exampleDomainIdentity", DomainIdentityArgs.builder()
.domain("example.com")
.build());
final var example = IamFunctions.getPolicyDocument(GetPolicyDocumentArgs.builder()
.statements(GetPolicyDocumentStatementArgs.builder()
.actions(
"SES:SendEmail",
"SES:SendRawEmail")
.resources(exampleDomainIdentity.arn())
.principals(GetPolicyDocumentStatementPrincipalArgs.builder()
.identifiers("*")
.type("AWS")
.build())
.build())
.build());
var exampleIdentityPolicy = new IdentityPolicy("exampleIdentityPolicy", IdentityPolicyArgs.builder()
.identity(exampleDomainIdentity.arn())
.name("example")
.policy(example.applyValue(getPolicyDocumentResult -> getPolicyDocumentResult).applyValue(example -> example.applyValue(getPolicyDocumentResult -> getPolicyDocumentResult.json())))
.build());
}
}
resources:
exampleDomainIdentity:
type: aws:ses:DomainIdentity
name: example
properties:
domain: example.com
exampleIdentityPolicy:
type: aws:ses:IdentityPolicy
name: example
properties:
identity: ${exampleDomainIdentity.arn}
name: example
policy: ${example.json}
variables:
example:
fn::invoke:
Function: aws:iam:getPolicyDocument
Arguments:
statements:
- actions:
- SES:SendEmail
- SES:SendRawEmail
resources:
- ${exampleDomainIdentity.arn}
principals:
- identifiers:
- '*'
type: AWS
Create IdentityPolicy Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new IdentityPolicy(name: string, args: IdentityPolicyArgs, opts?: CustomResourceOptions);
@overload
def IdentityPolicy(resource_name: str,
args: IdentityPolicyArgs,
opts: Optional[ResourceOptions] = None)
@overload
def IdentityPolicy(resource_name: str,
opts: Optional[ResourceOptions] = None,
identity: Optional[str] = None,
policy: Optional[str] = None,
name: Optional[str] = None)
func NewIdentityPolicy(ctx *Context, name string, args IdentityPolicyArgs, opts ...ResourceOption) (*IdentityPolicy, error)
public IdentityPolicy(string name, IdentityPolicyArgs args, CustomResourceOptions? opts = null)
public IdentityPolicy(String name, IdentityPolicyArgs args)
public IdentityPolicy(String name, IdentityPolicyArgs args, CustomResourceOptions options)
type: aws:ses:IdentityPolicy
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 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.
- args IdentityPolicyArgs
- 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 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.
- name String
- The unique name of the resource.
- args IdentityPolicyArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var identityPolicyResource = new Aws.Ses.IdentityPolicy("identityPolicyResource", new()
{
Identity = "string",
Policy = "string",
Name = "string",
});
example, err := ses.NewIdentityPolicy(ctx, "identityPolicyResource", &ses.IdentityPolicyArgs{
Identity: pulumi.String("string"),
Policy: pulumi.String("string"),
Name: pulumi.String("string"),
})
var identityPolicyResource = new IdentityPolicy("identityPolicyResource", IdentityPolicyArgs.builder()
.identity("string")
.policy("string")
.name("string")
.build());
identity_policy_resource = aws.ses.IdentityPolicy("identityPolicyResource",
identity="string",
policy="string",
name="string")
const identityPolicyResource = new aws.ses.IdentityPolicy("identityPolicyResource", {
identity: "string",
policy: "string",
name: "string",
});
type: aws:ses:IdentityPolicy
properties:
identity: string
name: string
policy: string
IdentityPolicy Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The IdentityPolicy resource accepts the following input properties:
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 string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up 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
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
identity: Optional[str] = None,
name: Optional[str] = None,
policy: Optional[str] = None) -> IdentityPolicy
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)
public static IdentityPolicy get(String name, Output<String> id, IdentityPolicyState 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.
Import
Using pulumi import
, import SES Identity Policies using the identity and policy name, separated by a pipe character (|
). For example:
$ pulumi import aws:ses/identityPolicy:IdentityPolicy example 'example.com|example'
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.