awslabs / aws-service-catalog-puppet

This is a framework where you list your AWS accounts with tags and your AWS Service Catalog products with tags or target accounts. The framework works through your lists, dedupes and spots collisions and then provisions the products into your AWS accounts for you. It handles the Portfolio sharing, its acceptance and can provision products cross account and cross region.
Apache License 2.0
76 stars 41 forks source link

Unable to install #604

Open shayfisher opened 1 year ago

shayfisher commented 1 year ago

I've tried installing using this URL: Successfully installed the AWS Organization integration. Then after launching the pre-configured template and setting Cloudformation to preserve failed components -

The deployment fails on the StartInstall custom resource creation. When I look at the codebuild project (servicecatalog-product-puppet-initialiser - used default values) I see the following errors: `

Starting bootstrap -- 230 | Traceback (most recent call last): 231 | File "/root/.pyenv/versions/3.9.12/lib/python3.9/site-packages/servicecatalog_puppet/commands/bootstrap.py", line 72, in bootstrap 232 | client.describe_event_bus(Name=constants.EVENT_BUS_NAME) 233 | File "/root/.pyenv/versions/3.9.12/lib/python3.9/site-packages/botocore/client.py", line 530, in _api_call 234 | return self._make_api_call(operation_name, kwargs) 235 | File "/root/.pyenv/versions/3.9.12/lib/python3.9/site-packages/botocore/client.py", line 960, in _make_api_call 236 | raise error_class(parsed_response, operation_name) 237 | botocore.errorfactory.ResourceNotFoundException: An error occurred (ResourceNotFoundException) when calling the DescribeEventBus operation: Event bus servicecatalog-puppet-event-bus does not exist. 238 |   239 | During handling of the above exception, another exception occurred: 240 |   241 | Traceback (most recent call last): 242 | File "/root/.pyenv/versions/3.9.12/bin/servicecatalog-puppet", line 8, in 243 | sys.exit(cli()) 244 | File "/root/.pyenv/versions/3.9.12/lib/python3.9/site-packages/click/core.py", line 764, in __call__ 245 | return self.main(*args, **kwargs) 246 | File "/root/.pyenv/versions/3.9.12/lib/python3.9/site-packages/click/core.py", line 717, in main 247 | rv = self.invoke(ctx) 248 | File "/root/.pyenv/versions/3.9.12/lib/python3.9/site-packages/click/core.py", line 1137, in invoke 249 | return _process_result(sub_ctx.command.invoke(sub_ctx)) 250 | File "/root/.pyenv/versions/3.9.12/lib/python3.9/site-packages/click/core.py", line 956, in invoke 251 | return ctx.invoke(self.callback, **ctx.params) 252 | File "/root/.pyenv/versions/3.9.12/lib/python3.9/site-packages/click/core.py", line 555, in invoke 253 | return callback(*args, **kwargs) 254 | File "/root/.pyenv/versions/3.9.12/lib/python3.9/site-packages/servicecatalog_puppet/cli.py", line 347, in bootstrap 255 | bootstrap_commands.bootstrap(**parameters) 256 | File "/root/.pyenv/versions/3.9.12/lib/python3.9/site-packages/servicecatalog_puppet/commands/bootstrap.py", line 73, in bootstrap 257 | except events.exceptions.ResourceNotFoundException: 258 | UnboundLocalError: local variable 'events' referenced before assignment 259 |   260 | [Container] 2022/11/27 07:24:08 Command did not exit successfully servicecatalog-puppet --info bootstrap exit status 1 261 | [Container] 2022/11/27 07:24:08 Phase complete: BUILD State: FAILED 262 | [Container] 2022/11/27 07:24:08 Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command: servicecatalog-puppet --info bootstrap. Reason: exit status 1 263 | [Container] 2022/11/27 07:24:08 Entering phase POST_BUILD 264 | [Container] 2022/11/27 07:24:08 Phase complete: POST_BUILD State: SUCCEEDED 265 | [Container] 2022/11/27 07:24:08 Phase context status code: Message:

`

I tried looking at the CFN templates but couldn't see the creation of an event bus named - servicecatalog-puppet-event-bus Am I missing something ? Thank you!

eamonnfaherty commented 1 year ago

can you please confirm you are using the latest initialiser template from https://service-catalog-tools.s3.eu-west-2.amazonaws.com/puppet/latest/servicecatalog-puppet-initialiser.template.yaml

I have tried to recreate this but cannot. Could you please share your full codebuild logs.

shayfisher commented 1 year ago

Hi @eamonnfaherty , Just tried deploying right now. Deployed this https://service-catalog-tools-workshop.com/installation/30-service-catalog-puppet/10-using-aws-organizations.html correctly to the management account - used version 0.211.0 as the version and the management account id as the puppet account id. Set the parameter in SSM and carried on to the next step. Tried deploying this: https://service-catalog-tools-workshop.com/installation/30-service-catalog-puppet/30-installing-puppet.html If failed on different issues now (non existing roles): image It is weird because those roles are being deployed by the cloudformation snippet itself on the second step

shayfisher commented 1 year ago

Hi @eamonnfaherty Tried now with latest release and the second step deployment rolled back - image

What information do you need me to provide in order to make some progress on this issue ? Thank you!

sandrich commented 1 year ago

Looks like I am hitting the same issue @eamonnfaherty

Setting the following to true on the puppet init template it works

ShouldCollectCloudformationEvents | true 
ShouldForwardEventsToEventbridge | true
eamonnfaherty commented 1 year ago

@sandrich does your error message match the one in this issue?

sandrich commented 1 year ago

@eamonnfaherty yes. Your new release seems to have fixed it.