github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/ses/domainIdentity.go (about) 1 // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. 2 // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** 3 4 package ses 5 6 import ( 7 "context" 8 "reflect" 9 10 "errors" 11 "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" 12 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 13 ) 14 15 // Provides an SES domain identity resource 16 // 17 // ## Example Usage 18 // 19 // ### Basic Usage 20 // 21 // <!--Start PulumiCodeChooser --> 22 // ```go 23 // package main 24 // 25 // import ( 26 // 27 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ses" 28 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 29 // 30 // ) 31 // 32 // func main() { 33 // pulumi.Run(func(ctx *pulumi.Context) error { 34 // _, err := ses.NewDomainIdentity(ctx, "example", &ses.DomainIdentityArgs{ 35 // Domain: pulumi.String("example.com"), 36 // }) 37 // if err != nil { 38 // return err 39 // } 40 // return nil 41 // }) 42 // } 43 // 44 // ``` 45 // <!--End PulumiCodeChooser --> 46 // 47 // ### With Route53 Record 48 // 49 // <!--Start PulumiCodeChooser --> 50 // ```go 51 // package main 52 // 53 // import ( 54 // 55 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/route53" 56 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ses" 57 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 58 // 59 // ) 60 // 61 // func main() { 62 // pulumi.Run(func(ctx *pulumi.Context) error { 63 // example, err := ses.NewDomainIdentity(ctx, "example", &ses.DomainIdentityArgs{ 64 // Domain: pulumi.String("example.com"), 65 // }) 66 // if err != nil { 67 // return err 68 // } 69 // _, err = route53.NewRecord(ctx, "example_amazonses_verification_record", &route53.RecordArgs{ 70 // ZoneId: pulumi.String("ABCDEFGHIJ123"), 71 // Name: pulumi.String("_amazonses.example.com"), 72 // Type: pulumi.String(route53.RecordTypeTXT), 73 // Ttl: pulumi.Int(600), 74 // Records: pulumi.StringArray{ 75 // example.VerificationToken, 76 // }, 77 // }) 78 // if err != nil { 79 // return err 80 // } 81 // return nil 82 // }) 83 // } 84 // 85 // ``` 86 // <!--End PulumiCodeChooser --> 87 // 88 // ## Import 89 // 90 // Using `pulumi import`, import SES domain identities using the domain name. For example: 91 // 92 // ```sh 93 // $ pulumi import aws:ses/domainIdentity:DomainIdentity example example.com 94 // ``` 95 type DomainIdentity struct { 96 pulumi.CustomResourceState 97 98 // The ARN of the domain identity. 99 Arn pulumi.StringOutput `pulumi:"arn"` 100 // The domain name to assign to SES 101 Domain pulumi.StringOutput `pulumi:"domain"` 102 // A code which when added to the domain as a TXT record 103 // will signal to SES that the owner of the domain has authorised SES to act on 104 // their behalf. The domain identity will be in state "verification pending" 105 // until this is done. See the With Route53 Record example 106 // for how this might be achieved when the domain is hosted in Route 53 and 107 // managed by this provider. Find out more about verifying domains in Amazon 108 // SES in the [AWS SES 109 // docs](http://docs.aws.amazon.com/ses/latest/DeveloperGuide/verify-domains.html). 110 VerificationToken pulumi.StringOutput `pulumi:"verificationToken"` 111 } 112 113 // NewDomainIdentity registers a new resource with the given unique name, arguments, and options. 114 func NewDomainIdentity(ctx *pulumi.Context, 115 name string, args *DomainIdentityArgs, opts ...pulumi.ResourceOption) (*DomainIdentity, error) { 116 if args == nil { 117 return nil, errors.New("missing one or more required arguments") 118 } 119 120 if args.Domain == nil { 121 return nil, errors.New("invalid value for required argument 'Domain'") 122 } 123 opts = internal.PkgResourceDefaultOpts(opts) 124 var resource DomainIdentity 125 err := ctx.RegisterResource("aws:ses/domainIdentity:DomainIdentity", name, args, &resource, opts...) 126 if err != nil { 127 return nil, err 128 } 129 return &resource, nil 130 } 131 132 // GetDomainIdentity gets an existing DomainIdentity resource's state with the given name, ID, and optional 133 // state properties that are used to uniquely qualify the lookup (nil if not required). 134 func GetDomainIdentity(ctx *pulumi.Context, 135 name string, id pulumi.IDInput, state *DomainIdentityState, opts ...pulumi.ResourceOption) (*DomainIdentity, error) { 136 var resource DomainIdentity 137 err := ctx.ReadResource("aws:ses/domainIdentity:DomainIdentity", name, id, state, &resource, opts...) 138 if err != nil { 139 return nil, err 140 } 141 return &resource, nil 142 } 143 144 // Input properties used for looking up and filtering DomainIdentity resources. 145 type domainIdentityState struct { 146 // The ARN of the domain identity. 147 Arn *string `pulumi:"arn"` 148 // The domain name to assign to SES 149 Domain *string `pulumi:"domain"` 150 // A code which when added to the domain as a TXT record 151 // will signal to SES that the owner of the domain has authorised SES to act on 152 // their behalf. The domain identity will be in state "verification pending" 153 // until this is done. See the With Route53 Record example 154 // for how this might be achieved when the domain is hosted in Route 53 and 155 // managed by this provider. Find out more about verifying domains in Amazon 156 // SES in the [AWS SES 157 // docs](http://docs.aws.amazon.com/ses/latest/DeveloperGuide/verify-domains.html). 158 VerificationToken *string `pulumi:"verificationToken"` 159 } 160 161 type DomainIdentityState struct { 162 // The ARN of the domain identity. 163 Arn pulumi.StringPtrInput 164 // The domain name to assign to SES 165 Domain pulumi.StringPtrInput 166 // A code which when added to the domain as a TXT record 167 // will signal to SES that the owner of the domain has authorised SES to act on 168 // their behalf. The domain identity will be in state "verification pending" 169 // until this is done. See the With Route53 Record example 170 // for how this might be achieved when the domain is hosted in Route 53 and 171 // managed by this provider. Find out more about verifying domains in Amazon 172 // SES in the [AWS SES 173 // docs](http://docs.aws.amazon.com/ses/latest/DeveloperGuide/verify-domains.html). 174 VerificationToken pulumi.StringPtrInput 175 } 176 177 func (DomainIdentityState) ElementType() reflect.Type { 178 return reflect.TypeOf((*domainIdentityState)(nil)).Elem() 179 } 180 181 type domainIdentityArgs struct { 182 // The domain name to assign to SES 183 Domain string `pulumi:"domain"` 184 } 185 186 // The set of arguments for constructing a DomainIdentity resource. 187 type DomainIdentityArgs struct { 188 // The domain name to assign to SES 189 Domain pulumi.StringInput 190 } 191 192 func (DomainIdentityArgs) ElementType() reflect.Type { 193 return reflect.TypeOf((*domainIdentityArgs)(nil)).Elem() 194 } 195 196 type DomainIdentityInput interface { 197 pulumi.Input 198 199 ToDomainIdentityOutput() DomainIdentityOutput 200 ToDomainIdentityOutputWithContext(ctx context.Context) DomainIdentityOutput 201 } 202 203 func (*DomainIdentity) ElementType() reflect.Type { 204 return reflect.TypeOf((**DomainIdentity)(nil)).Elem() 205 } 206 207 func (i *DomainIdentity) ToDomainIdentityOutput() DomainIdentityOutput { 208 return i.ToDomainIdentityOutputWithContext(context.Background()) 209 } 210 211 func (i *DomainIdentity) ToDomainIdentityOutputWithContext(ctx context.Context) DomainIdentityOutput { 212 return pulumi.ToOutputWithContext(ctx, i).(DomainIdentityOutput) 213 } 214 215 // DomainIdentityArrayInput is an input type that accepts DomainIdentityArray and DomainIdentityArrayOutput values. 216 // You can construct a concrete instance of `DomainIdentityArrayInput` via: 217 // 218 // DomainIdentityArray{ DomainIdentityArgs{...} } 219 type DomainIdentityArrayInput interface { 220 pulumi.Input 221 222 ToDomainIdentityArrayOutput() DomainIdentityArrayOutput 223 ToDomainIdentityArrayOutputWithContext(context.Context) DomainIdentityArrayOutput 224 } 225 226 type DomainIdentityArray []DomainIdentityInput 227 228 func (DomainIdentityArray) ElementType() reflect.Type { 229 return reflect.TypeOf((*[]*DomainIdentity)(nil)).Elem() 230 } 231 232 func (i DomainIdentityArray) ToDomainIdentityArrayOutput() DomainIdentityArrayOutput { 233 return i.ToDomainIdentityArrayOutputWithContext(context.Background()) 234 } 235 236 func (i DomainIdentityArray) ToDomainIdentityArrayOutputWithContext(ctx context.Context) DomainIdentityArrayOutput { 237 return pulumi.ToOutputWithContext(ctx, i).(DomainIdentityArrayOutput) 238 } 239 240 // DomainIdentityMapInput is an input type that accepts DomainIdentityMap and DomainIdentityMapOutput values. 241 // You can construct a concrete instance of `DomainIdentityMapInput` via: 242 // 243 // DomainIdentityMap{ "key": DomainIdentityArgs{...} } 244 type DomainIdentityMapInput interface { 245 pulumi.Input 246 247 ToDomainIdentityMapOutput() DomainIdentityMapOutput 248 ToDomainIdentityMapOutputWithContext(context.Context) DomainIdentityMapOutput 249 } 250 251 type DomainIdentityMap map[string]DomainIdentityInput 252 253 func (DomainIdentityMap) ElementType() reflect.Type { 254 return reflect.TypeOf((*map[string]*DomainIdentity)(nil)).Elem() 255 } 256 257 func (i DomainIdentityMap) ToDomainIdentityMapOutput() DomainIdentityMapOutput { 258 return i.ToDomainIdentityMapOutputWithContext(context.Background()) 259 } 260 261 func (i DomainIdentityMap) ToDomainIdentityMapOutputWithContext(ctx context.Context) DomainIdentityMapOutput { 262 return pulumi.ToOutputWithContext(ctx, i).(DomainIdentityMapOutput) 263 } 264 265 type DomainIdentityOutput struct{ *pulumi.OutputState } 266 267 func (DomainIdentityOutput) ElementType() reflect.Type { 268 return reflect.TypeOf((**DomainIdentity)(nil)).Elem() 269 } 270 271 func (o DomainIdentityOutput) ToDomainIdentityOutput() DomainIdentityOutput { 272 return o 273 } 274 275 func (o DomainIdentityOutput) ToDomainIdentityOutputWithContext(ctx context.Context) DomainIdentityOutput { 276 return o 277 } 278 279 // The ARN of the domain identity. 280 func (o DomainIdentityOutput) Arn() pulumi.StringOutput { 281 return o.ApplyT(func(v *DomainIdentity) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 282 } 283 284 // The domain name to assign to SES 285 func (o DomainIdentityOutput) Domain() pulumi.StringOutput { 286 return o.ApplyT(func(v *DomainIdentity) pulumi.StringOutput { return v.Domain }).(pulumi.StringOutput) 287 } 288 289 // A code which when added to the domain as a TXT record 290 // will signal to SES that the owner of the domain has authorised SES to act on 291 // their behalf. The domain identity will be in state "verification pending" 292 // until this is done. See the With Route53 Record example 293 // for how this might be achieved when the domain is hosted in Route 53 and 294 // managed by this provider. Find out more about verifying domains in Amazon 295 // SES in the [AWS SES 296 // docs](http://docs.aws.amazon.com/ses/latest/DeveloperGuide/verify-domains.html). 297 func (o DomainIdentityOutput) VerificationToken() pulumi.StringOutput { 298 return o.ApplyT(func(v *DomainIdentity) pulumi.StringOutput { return v.VerificationToken }).(pulumi.StringOutput) 299 } 300 301 type DomainIdentityArrayOutput struct{ *pulumi.OutputState } 302 303 func (DomainIdentityArrayOutput) ElementType() reflect.Type { 304 return reflect.TypeOf((*[]*DomainIdentity)(nil)).Elem() 305 } 306 307 func (o DomainIdentityArrayOutput) ToDomainIdentityArrayOutput() DomainIdentityArrayOutput { 308 return o 309 } 310 311 func (o DomainIdentityArrayOutput) ToDomainIdentityArrayOutputWithContext(ctx context.Context) DomainIdentityArrayOutput { 312 return o 313 } 314 315 func (o DomainIdentityArrayOutput) Index(i pulumi.IntInput) DomainIdentityOutput { 316 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *DomainIdentity { 317 return vs[0].([]*DomainIdentity)[vs[1].(int)] 318 }).(DomainIdentityOutput) 319 } 320 321 type DomainIdentityMapOutput struct{ *pulumi.OutputState } 322 323 func (DomainIdentityMapOutput) ElementType() reflect.Type { 324 return reflect.TypeOf((*map[string]*DomainIdentity)(nil)).Elem() 325 } 326 327 func (o DomainIdentityMapOutput) ToDomainIdentityMapOutput() DomainIdentityMapOutput { 328 return o 329 } 330 331 func (o DomainIdentityMapOutput) ToDomainIdentityMapOutputWithContext(ctx context.Context) DomainIdentityMapOutput { 332 return o 333 } 334 335 func (o DomainIdentityMapOutput) MapIndex(k pulumi.StringInput) DomainIdentityOutput { 336 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *DomainIdentity { 337 return vs[0].(map[string]*DomainIdentity)[vs[1].(string)] 338 }).(DomainIdentityOutput) 339 } 340 341 func init() { 342 pulumi.RegisterInputType(reflect.TypeOf((*DomainIdentityInput)(nil)).Elem(), &DomainIdentity{}) 343 pulumi.RegisterInputType(reflect.TypeOf((*DomainIdentityArrayInput)(nil)).Elem(), DomainIdentityArray{}) 344 pulumi.RegisterInputType(reflect.TypeOf((*DomainIdentityMapInput)(nil)).Elem(), DomainIdentityMap{}) 345 pulumi.RegisterOutputType(DomainIdentityOutput{}) 346 pulumi.RegisterOutputType(DomainIdentityArrayOutput{}) 347 pulumi.RegisterOutputType(DomainIdentityMapOutput{}) 348 }