/
domain_identity_verification.py
222 lines (188 loc) · 8.95 KB
/
domain_identity_verification.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
__all__ = ['DomainIdentityVerificationArgs', 'DomainIdentityVerification']
@pulumi.input_type
class DomainIdentityVerificationArgs:
def __init__(__self__, *,
domain: pulumi.Input[str]):
"""
The set of arguments for constructing a DomainIdentityVerification resource.
:param pulumi.Input[str] domain: The domain name of the SES domain identity to verify.
"""
pulumi.set(__self__, "domain", domain)
@property
@pulumi.getter
def domain(self) -> pulumi.Input[str]:
"""
The domain name of the SES domain identity to verify.
"""
return pulumi.get(self, "domain")
@domain.setter
def domain(self, value: pulumi.Input[str]):
pulumi.set(self, "domain", value)
@pulumi.input_type
class _DomainIdentityVerificationState:
def __init__(__self__, *,
arn: Optional[pulumi.Input[str]] = None,
domain: Optional[pulumi.Input[str]] = None):
"""
Input properties used for looking up and filtering DomainIdentityVerification resources.
:param pulumi.Input[str] arn: The ARN of the domain identity.
:param pulumi.Input[str] domain: The domain name of the SES domain identity to verify.
"""
if arn is not None:
pulumi.set(__self__, "arn", arn)
if domain is not None:
pulumi.set(__self__, "domain", domain)
@property
@pulumi.getter
def arn(self) -> Optional[pulumi.Input[str]]:
"""
The ARN of the domain identity.
"""
return pulumi.get(self, "arn")
@arn.setter
def arn(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "arn", value)
@property
@pulumi.getter
def domain(self) -> Optional[pulumi.Input[str]]:
"""
The domain name of the SES domain identity to verify.
"""
return pulumi.get(self, "domain")
@domain.setter
def domain(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "domain", value)
class DomainIdentityVerification(pulumi.CustomResource):
@overload
def __init__(__self__,
resource_name: str,
opts: Optional[pulumi.ResourceOptions] = None,
domain: Optional[pulumi.Input[str]] = None,
__props__=None):
"""
Represents a successful verification of an SES domain identity.
Most commonly, this resource is used together with `route53.Record` and
`ses.DomainIdentity` to request an SES domain identity,
deploy the required DNS verification records, and wait for verification to complete.
> **WARNING:** This resource implements a part of the verification workflow. It does not represent a real-world entity in AWS, therefore changing or deleting this resource on its own has no immediate effect.
## Example Usage
```python
import pulumi
import pulumi_aws as aws
example = aws.ses.DomainIdentity("example", domain="example.com")
example_amazonses_verification_record = aws.route53.Record("exampleAmazonsesVerificationRecord",
zone_id=aws_route53_zone["example"]["zone_id"],
name=example.id.apply(lambda id: f"_amazonses.{id}"),
type="TXT",
ttl=600,
records=[example.verification_token])
example_verification = aws.ses.DomainIdentityVerification("exampleVerification", domain=example.id,
opts=pulumi.ResourceOptions(depends_on=[example_amazonses_verification_record]))
```
:param str resource_name: The name of the resource.
:param pulumi.ResourceOptions opts: Options for the resource.
:param pulumi.Input[str] domain: The domain name of the SES domain identity to verify.
"""
...
@overload
def __init__(__self__,
resource_name: str,
args: DomainIdentityVerificationArgs,
opts: Optional[pulumi.ResourceOptions] = None):
"""
Represents a successful verification of an SES domain identity.
Most commonly, this resource is used together with `route53.Record` and
`ses.DomainIdentity` to request an SES domain identity,
deploy the required DNS verification records, and wait for verification to complete.
> **WARNING:** This resource implements a part of the verification workflow. It does not represent a real-world entity in AWS, therefore changing or deleting this resource on its own has no immediate effect.
## Example Usage
```python
import pulumi
import pulumi_aws as aws
example = aws.ses.DomainIdentity("example", domain="example.com")
example_amazonses_verification_record = aws.route53.Record("exampleAmazonsesVerificationRecord",
zone_id=aws_route53_zone["example"]["zone_id"],
name=example.id.apply(lambda id: f"_amazonses.{id}"),
type="TXT",
ttl=600,
records=[example.verification_token])
example_verification = aws.ses.DomainIdentityVerification("exampleVerification", domain=example.id,
opts=pulumi.ResourceOptions(depends_on=[example_amazonses_verification_record]))
```
:param str resource_name: The name of the resource.
:param DomainIdentityVerificationArgs args: The arguments to use to populate this resource's properties.
:param pulumi.ResourceOptions opts: Options for the resource.
"""
...
def __init__(__self__, resource_name: str, *args, **kwargs):
resource_args, opts = _utilities.get_resource_args_opts(DomainIdentityVerificationArgs, pulumi.ResourceOptions, *args, **kwargs)
if resource_args is not None:
__self__._internal_init(resource_name, opts, **resource_args.__dict__)
else:
__self__._internal_init(resource_name, *args, **kwargs)
def _internal_init(__self__,
resource_name: str,
opts: Optional[pulumi.ResourceOptions] = None,
domain: Optional[pulumi.Input[str]] = None,
__props__=None):
if opts is None:
opts = pulumi.ResourceOptions()
if not isinstance(opts, pulumi.ResourceOptions):
raise TypeError('Expected resource options to be a ResourceOptions instance')
if opts.version is None:
opts.version = _utilities.get_version()
if opts.id is None:
if __props__ is not None:
raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
__props__ = DomainIdentityVerificationArgs.__new__(DomainIdentityVerificationArgs)
if domain is None and not opts.urn:
raise TypeError("Missing required property 'domain'")
__props__.__dict__["domain"] = domain
__props__.__dict__["arn"] = None
super(DomainIdentityVerification, __self__).__init__(
'aws:ses/domainIdentityVerification:DomainIdentityVerification',
resource_name,
__props__,
opts)
@staticmethod
def get(resource_name: str,
id: pulumi.Input[str],
opts: Optional[pulumi.ResourceOptions] = None,
arn: Optional[pulumi.Input[str]] = None,
domain: Optional[pulumi.Input[str]] = None) -> 'DomainIdentityVerification':
"""
Get an existing DomainIdentityVerification resource's state with the given name, id, and optional extra
properties used to qualify the lookup.
:param str resource_name: The unique name of the resulting resource.
:param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
:param pulumi.ResourceOptions opts: Options for the resource.
:param pulumi.Input[str] arn: The ARN of the domain identity.
:param pulumi.Input[str] domain: The domain name of the SES domain identity to verify.
"""
opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))
__props__ = _DomainIdentityVerificationState.__new__(_DomainIdentityVerificationState)
__props__.__dict__["arn"] = arn
__props__.__dict__["domain"] = domain
return DomainIdentityVerification(resource_name, opts=opts, __props__=__props__)
@property
@pulumi.getter
def arn(self) -> pulumi.Output[str]:
"""
The ARN of the domain identity.
"""
return pulumi.get(self, "arn")
@property
@pulumi.getter
def domain(self) -> pulumi.Output[str]:
"""
The domain name of the SES domain identity to verify.
"""
return pulumi.get(self, "domain")