Use centralized ACCOUNT_ID (#4029)
This commit is contained in:
parent
6084d6cfe8
commit
5e4bccc22d
6 changed files with 30 additions and 22 deletions
|
|
@ -151,8 +151,8 @@ class Database(CloudFormationModel):
|
|||
|
||||
@property
|
||||
def db_instance_arn(self):
|
||||
return "arn:aws:rds:{0}:1234567890:db:{1}".format(
|
||||
self.region, self.db_instance_identifier
|
||||
return "arn:aws:rds:{0}:{1}:db:{2}".format(
|
||||
self.region, ACCOUNT_ID, self.db_instance_identifier
|
||||
)
|
||||
|
||||
@property
|
||||
|
|
@ -551,8 +551,8 @@ class Snapshot(BaseModel):
|
|||
|
||||
@property
|
||||
def snapshot_arn(self):
|
||||
return "arn:aws:rds:{0}:1234567890:snapshot:{1}".format(
|
||||
self.database.region, self.snapshot_id
|
||||
return "arn:aws:rds:{0}:{1}:snapshot:{2}".format(
|
||||
self.database.region, ACCOUNT_ID, self.snapshot_id
|
||||
)
|
||||
|
||||
def to_xml(self):
|
||||
|
|
@ -614,7 +614,7 @@ class SecurityGroup(CloudFormationModel):
|
|||
self.ip_ranges = []
|
||||
self.ec2_security_groups = []
|
||||
self.tags = tags
|
||||
self.owner_id = "1234567890"
|
||||
self.owner_id = ACCOUNT_ID
|
||||
self.vpc_id = None
|
||||
|
||||
def to_xml(self):
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@ import string
|
|||
import six
|
||||
import re
|
||||
|
||||
from moto.core import ACCOUNT_ID
|
||||
|
||||
|
||||
def random_password(
|
||||
password_length,
|
||||
|
|
@ -68,8 +70,8 @@ def random_password(
|
|||
|
||||
def secret_arn(region, secret_id):
|
||||
id_string = "".join(random.choice(string.ascii_letters) for _ in range(5))
|
||||
return "arn:aws:secretsmanager:{0}:1234567890:secret:{1}-{2}".format(
|
||||
region, secret_id, id_string
|
||||
return "arn:aws:secretsmanager:{0}:{1}:secret:{2}-{3}".format(
|
||||
region, ACCOUNT_ID, secret_id, id_string
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
ACCOUNT_ID = "1234567890"
|
||||
from moto.core import ACCOUNT_ID
|
||||
|
||||
|
||||
def parameter_arn(region, parameter_name):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue