Use the specified region name when generating ARN for a requested cert.
This commit is contained in:
parent
c0c86be6ee
commit
66a7ace2c5
@ -105,7 +105,7 @@ class CertBundle(BaseModel):
|
||||
self.arn = arn
|
||||
|
||||
@classmethod
|
||||
def generate_cert(cls, domain_name, sans=None):
|
||||
def generate_cert(cls, domain_name, region, sans=None):
|
||||
if sans is None:
|
||||
sans = set()
|
||||
else:
|
||||
@ -152,7 +152,7 @@ class CertBundle(BaseModel):
|
||||
encryption_algorithm=serialization.NoEncryption()
|
||||
)
|
||||
|
||||
return cls(cert_armored, private_key, cert_type='AMAZON_ISSUED', cert_status='PENDING_VALIDATION')
|
||||
return cls(cert_armored, private_key, cert_type='AMAZON_ISSUED', cert_status='PENDING_VALIDATION', region=region)
|
||||
|
||||
def validate_pk(self):
|
||||
try:
|
||||
@ -355,7 +355,7 @@ class AWSCertificateManagerBackend(BaseBackend):
|
||||
if arn is not None:
|
||||
return arn
|
||||
|
||||
cert = CertBundle.generate_cert(domain_name, subject_alt_names)
|
||||
cert = CertBundle.generate_cert(domain_name, region=self.region, sans=subject_alt_names)
|
||||
if idempotency_token is not None:
|
||||
self._set_idempotency_token_arn(idempotency_token, cert.arn)
|
||||
self._certificates[cert.arn] = cert
|
||||
|
@ -291,6 +291,7 @@ def test_request_certificate():
|
||||
)
|
||||
resp.should.contain('CertificateArn')
|
||||
arn = resp['CertificateArn']
|
||||
arn.should.match(r"arn:aws:acm:eu-central-1:\d{12}:certificate/")
|
||||
|
||||
resp = client.request_certificate(
|
||||
DomainName='google.com',
|
||||
|
Loading…
Reference in New Issue
Block a user