Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@
ARN_STACK_REGEX = re.compile(
r"arn:(aws|aws-us-gov|aws-cn):cloudformation:[-a-zA-Z0-9]+:\d{12}:stack/[a-zA-Z][-a-zA-Z0-9]*/[-a-zA-Z0-9:/._+]+"
)
ARN_STACK_SET_REGEX = re.compile(
r"arn:(aws|aws-us-gov|aws-cn):cloudformation:[-a-zA-Z0-9]+:\d{12}:stack-set/[a-zA-Z][-a-zA-Z0-9]*/[-a-zA-Z0-9:/._+]+"
)


def clone_stack_params(stack_params):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from localstack.services.cloudformation.engine.entities import Stack, StackChangeSet, StackSet
from localstack.services.cloudformation.v2.entities import ChangeSet as ChangeSetV2
from localstack.services.cloudformation.v2.entities import Stack as StackV2
from localstack.services.cloudformation.v2.entities import StackSet as StackSetV2
from localstack.services.stores import AccountRegionBundle, BaseStore, LocalAttribute

LOG = logging.getLogger(__name__)
Expand All @@ -19,6 +20,7 @@ class CloudFormationStore(BaseStore):

# maps stack set ID to stack set details
stack_sets: dict[str, StackSet] = LocalAttribute(default=dict)
stack_sets_v2: dict[str, StackSetV2] = LocalAttribute(default=dict)

# maps macro ID to macros
macros: dict[str, dict] = LocalAttribute(default=dict)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,19 @@
ChangeSetType,
CreateChangeSetInput,
CreateStackInput,
CreateStackSetInput,
ExecutionStatus,
Output,
Parameter,
ResourceStatus,
StackDriftInformation,
StackDriftStatus,
StackEvent,
StackInstanceComprehensiveStatus,
StackInstanceDetailedStatus,
StackInstanceStatus,
StackResource,
StackSetOperation,
StackStatus,
StackStatusReason,
)
Expand Down Expand Up @@ -270,3 +275,36 @@ def account_id(self) -> str:
@property
def region_name(self) -> str:
return self.stack.region_name


class StackInstance:
def __init__(
self, account_id: str, region_name: str, stack_set_id: str, operation_id: str, stack_id: str
):
self.account_id = account_id
self.region_name = region_name
self.stack_set_id = stack_set_id
self.operation_id = operation_id
self.stack_id = stack_id

self.status: StackInstanceStatus = StackInstanceStatus.CURRENT
self.stack_instance_status = StackInstanceComprehensiveStatus(
DetailedStatus=StackInstanceDetailedStatus.SUCCEEDED
)


class StackSet:
stack_instances: list[StackInstance]
operations: dict[str, StackSetOperation]

def __init__(self, account_id: str, region_name: str, request_payload: CreateStackSetInput):
self.account_id = account_id
self.region_name = region_name

self.stack_set_name = request_payload["StackSetName"]
self.stack_set_id = f"{self.stack_set_name}:{long_uid()}"
self.template_body = request_payload.get("TemplateBody")
self.template_url = request_payload.get("TemplateURL")

self.stack_instances = []
self.operations = {}
Loading
Loading