github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/ses/emailIdentity.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 email identity resource 16 // 17 // ## Example Usage 18 // 19 // <!--Start PulumiCodeChooser --> 20 // ```go 21 // package main 22 // 23 // import ( 24 // 25 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ses" 26 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 27 // 28 // ) 29 // 30 // func main() { 31 // pulumi.Run(func(ctx *pulumi.Context) error { 32 // _, err := ses.NewEmailIdentity(ctx, "example", &ses.EmailIdentityArgs{ 33 // Email: pulumi.String("email@example.com"), 34 // }) 35 // if err != nil { 36 // return err 37 // } 38 // return nil 39 // }) 40 // } 41 // 42 // ``` 43 // <!--End PulumiCodeChooser --> 44 // 45 // ## Import 46 // 47 // Using `pulumi import`, import SES email identities using the email address. For example: 48 // 49 // ```sh 50 // $ pulumi import aws:ses/emailIdentity:EmailIdentity example email@example.com 51 // ``` 52 type EmailIdentity struct { 53 pulumi.CustomResourceState 54 55 // The ARN of the email identity. 56 Arn pulumi.StringOutput `pulumi:"arn"` 57 // The email address to assign to SES. 58 Email pulumi.StringOutput `pulumi:"email"` 59 } 60 61 // NewEmailIdentity registers a new resource with the given unique name, arguments, and options. 62 func NewEmailIdentity(ctx *pulumi.Context, 63 name string, args *EmailIdentityArgs, opts ...pulumi.ResourceOption) (*EmailIdentity, error) { 64 if args == nil { 65 return nil, errors.New("missing one or more required arguments") 66 } 67 68 if args.Email == nil { 69 return nil, errors.New("invalid value for required argument 'Email'") 70 } 71 opts = internal.PkgResourceDefaultOpts(opts) 72 var resource EmailIdentity 73 err := ctx.RegisterResource("aws:ses/emailIdentity:EmailIdentity", name, args, &resource, opts...) 74 if err != nil { 75 return nil, err 76 } 77 return &resource, nil 78 } 79 80 // GetEmailIdentity gets an existing EmailIdentity resource's state with the given name, ID, and optional 81 // state properties that are used to uniquely qualify the lookup (nil if not required). 82 func GetEmailIdentity(ctx *pulumi.Context, 83 name string, id pulumi.IDInput, state *EmailIdentityState, opts ...pulumi.ResourceOption) (*EmailIdentity, error) { 84 var resource EmailIdentity 85 err := ctx.ReadResource("aws:ses/emailIdentity:EmailIdentity", name, id, state, &resource, opts...) 86 if err != nil { 87 return nil, err 88 } 89 return &resource, nil 90 } 91 92 // Input properties used for looking up and filtering EmailIdentity resources. 93 type emailIdentityState struct { 94 // The ARN of the email identity. 95 Arn *string `pulumi:"arn"` 96 // The email address to assign to SES. 97 Email *string `pulumi:"email"` 98 } 99 100 type EmailIdentityState struct { 101 // The ARN of the email identity. 102 Arn pulumi.StringPtrInput 103 // The email address to assign to SES. 104 Email pulumi.StringPtrInput 105 } 106 107 func (EmailIdentityState) ElementType() reflect.Type { 108 return reflect.TypeOf((*emailIdentityState)(nil)).Elem() 109 } 110 111 type emailIdentityArgs struct { 112 // The email address to assign to SES. 113 Email string `pulumi:"email"` 114 } 115 116 // The set of arguments for constructing a EmailIdentity resource. 117 type EmailIdentityArgs struct { 118 // The email address to assign to SES. 119 Email pulumi.StringInput 120 } 121 122 func (EmailIdentityArgs) ElementType() reflect.Type { 123 return reflect.TypeOf((*emailIdentityArgs)(nil)).Elem() 124 } 125 126 type EmailIdentityInput interface { 127 pulumi.Input 128 129 ToEmailIdentityOutput() EmailIdentityOutput 130 ToEmailIdentityOutputWithContext(ctx context.Context) EmailIdentityOutput 131 } 132 133 func (*EmailIdentity) ElementType() reflect.Type { 134 return reflect.TypeOf((**EmailIdentity)(nil)).Elem() 135 } 136 137 func (i *EmailIdentity) ToEmailIdentityOutput() EmailIdentityOutput { 138 return i.ToEmailIdentityOutputWithContext(context.Background()) 139 } 140 141 func (i *EmailIdentity) ToEmailIdentityOutputWithContext(ctx context.Context) EmailIdentityOutput { 142 return pulumi.ToOutputWithContext(ctx, i).(EmailIdentityOutput) 143 } 144 145 // EmailIdentityArrayInput is an input type that accepts EmailIdentityArray and EmailIdentityArrayOutput values. 146 // You can construct a concrete instance of `EmailIdentityArrayInput` via: 147 // 148 // EmailIdentityArray{ EmailIdentityArgs{...} } 149 type EmailIdentityArrayInput interface { 150 pulumi.Input 151 152 ToEmailIdentityArrayOutput() EmailIdentityArrayOutput 153 ToEmailIdentityArrayOutputWithContext(context.Context) EmailIdentityArrayOutput 154 } 155 156 type EmailIdentityArray []EmailIdentityInput 157 158 func (EmailIdentityArray) ElementType() reflect.Type { 159 return reflect.TypeOf((*[]*EmailIdentity)(nil)).Elem() 160 } 161 162 func (i EmailIdentityArray) ToEmailIdentityArrayOutput() EmailIdentityArrayOutput { 163 return i.ToEmailIdentityArrayOutputWithContext(context.Background()) 164 } 165 166 func (i EmailIdentityArray) ToEmailIdentityArrayOutputWithContext(ctx context.Context) EmailIdentityArrayOutput { 167 return pulumi.ToOutputWithContext(ctx, i).(EmailIdentityArrayOutput) 168 } 169 170 // EmailIdentityMapInput is an input type that accepts EmailIdentityMap and EmailIdentityMapOutput values. 171 // You can construct a concrete instance of `EmailIdentityMapInput` via: 172 // 173 // EmailIdentityMap{ "key": EmailIdentityArgs{...} } 174 type EmailIdentityMapInput interface { 175 pulumi.Input 176 177 ToEmailIdentityMapOutput() EmailIdentityMapOutput 178 ToEmailIdentityMapOutputWithContext(context.Context) EmailIdentityMapOutput 179 } 180 181 type EmailIdentityMap map[string]EmailIdentityInput 182 183 func (EmailIdentityMap) ElementType() reflect.Type { 184 return reflect.TypeOf((*map[string]*EmailIdentity)(nil)).Elem() 185 } 186 187 func (i EmailIdentityMap) ToEmailIdentityMapOutput() EmailIdentityMapOutput { 188 return i.ToEmailIdentityMapOutputWithContext(context.Background()) 189 } 190 191 func (i EmailIdentityMap) ToEmailIdentityMapOutputWithContext(ctx context.Context) EmailIdentityMapOutput { 192 return pulumi.ToOutputWithContext(ctx, i).(EmailIdentityMapOutput) 193 } 194 195 type EmailIdentityOutput struct{ *pulumi.OutputState } 196 197 func (EmailIdentityOutput) ElementType() reflect.Type { 198 return reflect.TypeOf((**EmailIdentity)(nil)).Elem() 199 } 200 201 func (o EmailIdentityOutput) ToEmailIdentityOutput() EmailIdentityOutput { 202 return o 203 } 204 205 func (o EmailIdentityOutput) ToEmailIdentityOutputWithContext(ctx context.Context) EmailIdentityOutput { 206 return o 207 } 208 209 // The ARN of the email identity. 210 func (o EmailIdentityOutput) Arn() pulumi.StringOutput { 211 return o.ApplyT(func(v *EmailIdentity) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 212 } 213 214 // The email address to assign to SES. 215 func (o EmailIdentityOutput) Email() pulumi.StringOutput { 216 return o.ApplyT(func(v *EmailIdentity) pulumi.StringOutput { return v.Email }).(pulumi.StringOutput) 217 } 218 219 type EmailIdentityArrayOutput struct{ *pulumi.OutputState } 220 221 func (EmailIdentityArrayOutput) ElementType() reflect.Type { 222 return reflect.TypeOf((*[]*EmailIdentity)(nil)).Elem() 223 } 224 225 func (o EmailIdentityArrayOutput) ToEmailIdentityArrayOutput() EmailIdentityArrayOutput { 226 return o 227 } 228 229 func (o EmailIdentityArrayOutput) ToEmailIdentityArrayOutputWithContext(ctx context.Context) EmailIdentityArrayOutput { 230 return o 231 } 232 233 func (o EmailIdentityArrayOutput) Index(i pulumi.IntInput) EmailIdentityOutput { 234 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *EmailIdentity { 235 return vs[0].([]*EmailIdentity)[vs[1].(int)] 236 }).(EmailIdentityOutput) 237 } 238 239 type EmailIdentityMapOutput struct{ *pulumi.OutputState } 240 241 func (EmailIdentityMapOutput) ElementType() reflect.Type { 242 return reflect.TypeOf((*map[string]*EmailIdentity)(nil)).Elem() 243 } 244 245 func (o EmailIdentityMapOutput) ToEmailIdentityMapOutput() EmailIdentityMapOutput { 246 return o 247 } 248 249 func (o EmailIdentityMapOutput) ToEmailIdentityMapOutputWithContext(ctx context.Context) EmailIdentityMapOutput { 250 return o 251 } 252 253 func (o EmailIdentityMapOutput) MapIndex(k pulumi.StringInput) EmailIdentityOutput { 254 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *EmailIdentity { 255 return vs[0].(map[string]*EmailIdentity)[vs[1].(string)] 256 }).(EmailIdentityOutput) 257 } 258 259 func init() { 260 pulumi.RegisterInputType(reflect.TypeOf((*EmailIdentityInput)(nil)).Elem(), &EmailIdentity{}) 261 pulumi.RegisterInputType(reflect.TypeOf((*EmailIdentityArrayInput)(nil)).Elem(), EmailIdentityArray{}) 262 pulumi.RegisterInputType(reflect.TypeOf((*EmailIdentityMapInput)(nil)).Elem(), EmailIdentityMap{}) 263 pulumi.RegisterOutputType(EmailIdentityOutput{}) 264 pulumi.RegisterOutputType(EmailIdentityArrayOutput{}) 265 pulumi.RegisterOutputType(EmailIdentityMapOutput{}) 266 }