I have an instance with a role, that can pretty much do nothing. We have a second role that allows for cloudformation deployments only that can be assumed by the original role. This works when I use the aws cli to manually assume the role before a runway takeoff
, but fails when I instead rely on runway to assume the role for me.
Correct role in runway.yml: arn:aws:iam::########:role/assumerol-AssumeRole-1GXCX51B43A27
Role instance was launched with: arn:aws:sts::#####:assumed-role/instance17-ServerRole-OYAM3DY5SD4Q
deployments:
- modules:
- fargate.cfn
regions:
- us-east-1
assume-role:
arn: arn:aws:iam::########:role/assumerol-AssumeRole-1GXCX51B43A27
ignore_git_branch: true
13:54:29 --------------------------------------------------------------------------------
13:54:29 executing runway takeoff...
13:54:29 --------------------------------------------------------------------------------
13:54:29 INFO:botocore.vendored.requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 169.254.169.254
13:54:29 INFO:botocore.vendored.requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 169.254.169.254
13:54:29 INFO:runway:Assuming role arn:aws:iam::########:role/assumerol-AssumeRole-1GXCX51B43A27...
13:54:29 INFO:botocore.vendored.requests.packages.urllib3.connectionpool:Starting new HTTPS connection (1): sts.amazonaws.com
13:54:29 INFO:runway:Skipping environment lookup from current git branch ("ignore_git_branch" is set to true in the runway config)
13:54:29 INFO:runway:Deriving environment name from directory /app/jenkins/workspace/Dashboard_Promote/dev...
13:54:29 INFO:runway:Deploying to dev environment in region us-east-1...
13:54:29 INFO:runway:Running stacker build on fargate.yaml
13:54:29 INFO:runway.embedded.stacker.commands.stacker:Using interactive AWS provider mode.
13:54:29 INFO:runway.embedded.stacker.plan:Plan Status:
13:54:29 INFO:runway.embedded.stacker.plan: dev-dashboard-fargate: pending
13:54:30 Traceback (most recent call last):
13:54:30 File "/app/jenkins/workspace/Dashboard_Promote/venv/bin/runway", line 11, in <module>
13:54:30 sys.exit(main())
13:54:30 File "/app/jenkins/workspace/Dashboard_Promote/venv/lib/python2.7/site-packages/runway/cli.py", line 56, in main
13:54:30 command.execute()
13:54:30 File "/app/jenkins/workspace/Dashboard_Promote/venv/lib/python2.7/site-packages/runway/commands/takeoff.py", line 10, in execute
13:54:30 self.deploy()
13:54:30 File "/app/jenkins/workspace/Dashboard_Promote/venv/lib/python2.7/site-packages/runway/commands/env.py", line 84, in deploy
13:54:30 self.run(deployments=deployments, command='deploy')
13:54:30 File "/app/jenkins/workspace/Dashboard_Promote/venv/lib/python2.7/site-packages/runway/commands/env.py", line 68, in run
13:54:30 command)()
13:54:30 File "/app/jenkins/workspace/Dashboard_Promote/venv/lib/python2.7/site-packages/runway/commands/module.py", line 431, in deploy
13:54:30 command='build'
13:54:30 File "/app/jenkins/workspace/Dashboard_Promote/venv/lib/python2.7/site-packages/runway/commands/module.py", line 346, in run_stacker
13:54:30 args.run(args)
13:54:30 File "/app/jenkins/workspace/Dashboard_Promote/venv/lib/python2.7/site-packages/runway/embedded/stacker/commands/stacker/build.py", line 46, in run
13:54:30 dump=options.dump)
13:54:30 File "/app/jenkins/workspace/Dashboard_Promote/venv/lib/python2.7/site-packages/runway/embedded/stacker/actions/base.py", line 131, in execute
13:54:30 self.run(*args, **kwargs)
13:54:30 File "/app/jenkins/workspace/Dashboard_Promote/venv/lib/python2.7/site-packages/runway/embedded/stacker/actions/build.py", line 366, in run
13:54:30 plan.execute()
13:54:30 File "/app/jenkins/workspace/Dashboard_Promote/venv/lib/python2.7/site-packages/runway/embedded/stacker/plan.py", line 292, in execute
13:54:30 if not self._single_run():
13:54:30 File "/app/jenkins/workspace/Dashboard_Promote/venv/lib/python2.7/site-packages/runway/embedded/stacker/plan.py", line 252, in _single_run
13:54:30 status = step.run()
13:54:30 File "/app/jenkins/workspace/Dashboard_Promote/venv/lib/python2.7/site-packages/runway/embedded/stacker/plan.py", line 81, in run
13:54:30 return self._run_func(self.stack, status=self.status)
13:54:30 File "/app/jenkins/workspace/Dashboard_Promote/venv/lib/python2.7/site-packages/runway/embedded/stacker/actions/build.py", line 294, in _launch_stack
13:54:30 force_change_set=force_change_set
13:54:30 File "/app/jenkins/workspace/Dashboard_Promote/venv/lib/python2.7/site-packages/runway/embedded/stacker/providers/aws/default.", line 799, in update_stack
13:54:30 **kwargs)
13:54:30 File "/app/jenkins/workspace/Dashboard_Promote/venv/lib/python2.7/site-packages/runway/embedded/stacker/providers/aws/default.py", line 819, in interactive_update_stack
13:54:30 'UPDATE', service_role=self.service_role, **kwargs
13:54:30 File "/app/jenkins/workspace/Dashboard_Promote/venv/lib/python2.7/site-packages/runway/embedded/stacker/providers/aws/default.py", line 316, in create_change_set
13:54:30 kwargs=args
13:54:30 File "/app/jenkins/workspace/Dashboard_Promote/venv/lib/python2.7/site-packages/runway/embedded/stacker/providers/aws/default.py", line 81, in retry_on_throttling
13:54:30 retry_checker=_throttling_checker)
13:54:30 File "/app/jenkins/workspace/Dashboard_Promote/venv/lib/python2.7/site-packages/runway/embedded/stacker/util.py", line 76, in retry_with_backoff
13:54:30 return function(*args, **kwargs)
13:54:30 File "/app/jenkins/workspace/Dashboard_Promote/venv/lib/python2.7/site-packages/botocore/client.py", line 314, in _api_call
13:54:30 return self._make_api_call(operation_name, kwargs)
13:54:30 File "/app/jenkins/workspace/_Dashboard_Promote/venv/lib/python2.7/site-packages/botocore/client.py", line 612, in _make_api_call
13:54:30 raise error_class(parsed_response, operation_name)
13:54:30 botocore.exceptions.ClientError: An error occurred (AccessDenied) when calling the CreateChangeSet operation: User: arn:aws:sts::#####:assumed-role/instance17-ServerRole-OYAM3DY5SD4Q/i-##### is not authorized to perform: cloudformation:CreateChangeSet on resource: arn:aws:cloudformation:us-east-1:#####:stack/dev-dashboard-fargate/*
13:54:30 Build step 'Execute shell' marked build as failure
13:54:30 Finished: FAILURE