示例#1
0
 public MyStack()
 {
     var example = new Aws.Ses.DomainIdentity("example", new Aws.Ses.DomainIdentityArgs
     {
         Domain = "example.com",
     });
     var exampleAmazonsesVerificationRecord = new Aws.Route53.Record("exampleAmazonsesVerificationRecord", new Aws.Route53.RecordArgs
     {
         Name    = example.Id.Apply(id => $"_amazonses.{id}"),
         Records =
         {
             example.VerificationToken,
         },
         Ttl    = 600,
         Type   = "TXT",
         ZoneId = aws_route53_zone.Example.Zone_id,
     });
     var exampleVerification = new Aws.Ses.DomainIdentityVerification("exampleVerification", new Aws.Ses.DomainIdentityVerificationArgs
     {
         Domain = example.Id,
     }, new CustomResourceOptions
     {
         DependsOn =
         {
             "aws_route53_record.example_amazonses_verification_record",
         },
     });
 }
示例#2
0
    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   = "*****@*****.**",
            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,
        });
    }
示例#3
0
 public MyStack()
 {
     var example = new Aws.Ses.DomainIdentity("example", new Aws.Ses.DomainIdentityArgs
     {
         Domain = "example.com",
     });
     var exampleAmazonsesVerificationRecord = new Aws.Route53.Record("exampleAmazonsesVerificationRecord", new Aws.Route53.RecordArgs
     {
         Name    = "_amazonses.example.com",
         Records =
         {
             example.VerificationToken,
         },
         Ttl    = 600,
         Type   = "TXT",
         ZoneId = "ABCDEFGHIJ123",
     });
 }
示例#4
0
 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),
     });
 }
示例#5
0
 public MyStack()
 {
     // Example SES Domain Identity
     var exampleDomainIdentity = new Aws.Ses.DomainIdentity("exampleDomainIdentity", new Aws.Ses.DomainIdentityArgs
     {
         Domain = "example.com",
     });
     var exampleMailFrom = new Aws.Ses.MailFrom("exampleMailFrom", new Aws.Ses.MailFromArgs
     {
         Domain         = exampleDomainIdentity.Domain,
         MailFromDomain = exampleDomainIdentity.Domain.Apply(domain => $"bounce.{domain}"),
     });
     // Example Route53 MX record
     var exampleSesDomainMailFromMx = new Aws.Route53.Record("exampleSesDomainMailFromMx", new Aws.Route53.RecordArgs
     {
         Name    = exampleMailFrom.MailFromDomain,
         Records =
         {
             "10 feedback-smtp.us-east-1.amazonses.com",
         },
         Ttl    = 600,
         Type   = "MX",
         ZoneId = aws_route53_zone.Example.Id,
     });
     // Example Route53 TXT record for SPF
     var exampleSesDomainMailFromTxt = new Aws.Route53.Record("exampleSesDomainMailFromTxt", new Aws.Route53.RecordArgs
     {
         Name    = exampleMailFrom.MailFromDomain,
         Records =
         {
             "v=spf1 include:amazonses.com -all",
         },
         Ttl    = 600,
         Type   = "TXT",
         ZoneId = aws_route53_zone.Example.Id,
     });
 }