Skip to content

Commit

Permalink
Issues/692 (#693)
Browse files Browse the repository at this point in the history
  • Loading branch information
eamonnfaherty authored Nov 23, 2023
1 parent 24ab737 commit 3d1ff2f
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 13 deletions.
8 changes: 4 additions & 4 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

[tool.poetry]
name = "aws-service-catalog-puppet"
version = "0.242.1"
version = "0.243.0"
description = "Making it easier to deploy ServiceCatalog products"
classifiers = ["Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Programming Language :: Python :: 3", "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Natural Language :: English"]
homepage = "https://service-catalog-tools-workshop.com/"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from servicecatalog_puppet import constants, serialisation_utils
from servicecatalog_puppet.workflow import workflow_utils


SECTIONS_THAT_MUST_RUN_IN_HUB = [
constants.PORTFOLIO_SHARE_AND_ACCEPT_ACCOUNT,
]
Expand Down
19 changes: 12 additions & 7 deletions servicecatalog_puppet/workflow/stack/provision_stack_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def run(self):
)

existing_stack_params_dict = dict()
existing_template = ""
existing_template_from_cloudformation = ""
if status != "NoStack":
if status in constants.CLOUDFORMATION_HAPPY_STATUS:
with self.spoke_regional_client("cloudformation") as cloudformation:
Expand All @@ -232,25 +232,30 @@ def run(self):
StackName=self.stack_name_to_use, TemplateStage="Original"
).get("TemplateBody")
if isinstance(template_body, dict):
existing_template = template_body
existing_template_from_cloudformation = template_body
else:
try:
existing_template = cfn_tools.load_yaml(template_body)
existing_template_from_cloudformation = cfn_tools.load_yaml(
template_body
)
except Exception:
try:
existing_template = cfn_tools.load_json(template_body)
existing_template_from_cloudformation = cfn_tools.load_json(
template_body
)
except Exception:
raise Exception(
"Could not parse existing template as YAML or JSON"
)

template_to_use = cfn_tools.dump_yaml(template_to_provision)
if status in ["UPDATE_ROLLBACK_COMPLETE", "NoStack"]:
need_to_provision = True
else:
if existing_stack_params_dict == params_to_use:
self.info(f"params unchanged")
if template_to_use == cfn_tools.dump_yaml(existing_template):
if cfn_tools.dump_yaml(template_to_provision) == cfn_tools.dump_yaml(
existing_template_from_cloudformation
):
self.info(f"template the same")
need_to_provision = False
else:
Expand All @@ -269,7 +274,7 @@ def run(self):
with self.spoke_regional_client("cloudformation") as cloudformation:
a = dict(
StackName=self.stack_name_to_use,
TemplateBody=template_to_use,
TemplateBody=template_to_provision_source,
ShouldUseChangeSets=False,
Capabilities=self.capabilities,
Parameters=provisioning_parameters,
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@

setup_kwargs = {
'name': 'aws-service-catalog-puppet',
'version': '0.242.1',
'version': '0.243.0',
'description': 'Making it easier to deploy ServiceCatalog products',
'long_description': '# aws-service-catalog-puppet\n\n![logo](./docs/logo.png) \n\n## Badges\n\n[![codecov](https://codecov.io/gh/awslabs/aws-service-catalog-puppet/branch/master/graph/badge.svg?token=e8M7mdsmy0)](https://codecov.io/gh/awslabs/aws-service-catalog-puppet)\n\n\n## What is it?\nThis is a python3 framework that makes it easier to share multi region AWS Service Catalog portfolios and makes it \npossible to provision products into accounts declaratively using a metadata based rules engine.\n\nWith this framework you define your accounts in a YAML file. You give each account a set of tags, a default region and \na set of enabled regions.\n\nOnce you have done this you can define portfolios should be shared with each set of accounts using the tags and you \ncan specify which regions the shares occur in.\n\nIn addition to this, you can also define products that should be provisioned into accounts using the same tag based \napproach. The framework will assume role into the target account and provision the product on your behalf.\n\n\n## Getting started\n\nYou can read the [installation how to](https://service-catalog-tools-workshop.com/30-how-tos/10-installation/30-service-catalog-puppet.html)\nor you can read through the [every day use](https://service-catalog-tools-workshop.com/30-how-tos/50-every-day-use.html)\nguides.\n\nYou can read the [documentation](https://aws-service-catalog-puppet.readthedocs.io/en/latest/) to understand the inner \nworkings. \n\n\n## Going further\n\nThe framework is one of a pair. The other is [aws-service-catalog-factory](https://github.com/awslabs/aws-service-catalog-factory).\nWith Service Catalog Factory you can create pipelines that deploy multi region portfolios very easily. \n\n## License\n\nThis library is licensed under the Apache 2.0 License. \n \n',
'author': 'Eamonn Faherty',
Expand Down

0 comments on commit 3d1ff2f

Please sign in to comment.