aws-baseline icon indicating copy to clipboard operation
aws-baseline copied to clipboard

Exception on applying VPC StackSet

Open eduardohki opened this issue 5 years ago • 0 comments

Describe the bug StackSet error on formica stack-set create -c stack-set.config.yaml under stack-sets/08-vpc/:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/formica/stack_set.py", line 80, in create_stack_set
    client.describe_stack_set(StackSetName=args.stack_set)
  File "/usr/local/lib/python3.7/site-packages/botocore/client.py", line 357, in _api_call

    return self._make_api_call(operation_name, kwargs)
  File "/usr/local/lib/python3.7/site-packages/botocore/client.py", line 661, in _make_api_call
    raise error_class(parsed_response, operation_name)
botocore.errorfactory.StackSetNotFoundException: An error occurred (StackSetNotFoundException) when calling the DescribeStackSet operation: StackSet vpc not found

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/formica", line 10, in <module>
    sys.exit(formica())
  File "/usr/local/lib/python3.7/site-packages/formica/cli.py", line 72, in formica
    main(sys.argv[1:])
  File "/usr/local/lib/python3.7/site-packages/formica/cli.py", line 216, in main
    args.func(args)
  File "/usr/local/lib/python3.7/site-packages/formica/stack_set.py", line 26, in validate_stack_set
    function(args)
  File "/usr/local/lib/python3.7/site-packages/formica/stack_set.py", line 84, in create_stack_set
    __manage_stack_set(args=args, create=True)
  File "/usr/local/lib/python3.7/site-packages/formica/stack_set.py", line 255, in __manage_stack_set
    template = loader.template(indent=None)
  File "/usr/local/lib/python3.7/site-packages/formica/loader.py", line 107, in template
    return json.dumps(self.cftemplate, indent=indent, sort_keys=sort_keys, separators=separators)
  File "/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/__init__.py", line 238, in dumps
    **kw).encode(obj)
  File "/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/encoder.py", line 199, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/encoder.py", line 257, in iterencode
    return _iterencode(o, 0)
TypeError: '<' not supported between instances of 'str' and 'int'

Expected behavior The StackSets get created

Screenshots N/A

Additional context formica is installed locally on my Mac

There just a few changes in the stack-set.config.yaml file:

  • AvailabilityZones is set to 2 (as number)
  • AccountCIDR custom setting is enabled (as in the commented section)
  • PrivateNatGateway parameter is set to all
  • GatewayEndpoints and InterfaceEndpoints items are set

My stack-set.config.yml file:

stack: vpc
stack-set: vpc
vars:
  AvailabilityZones: 2
  GatewayEndpoints:
    - s3
  InterfaceEndpoints:
    - monitoring
    - logs
    - ecr.dkr
    - ecr.api
  AccountCIDR:
    000000000000:
      "eu-central-1": 10.150.0.0/16
    111111111111:
      "eu-central-1": 10.160.0.0/16
    222222222222:
      "eu-central-1": 10.170.0.0/16
    333333333333:
      "eu-central-1": 10.180.0.0/16

parameters:
  PrivateNatGateway: all
all-subaccounts: true
regions:
  - eu-central-1
max-concurrent-percentage: 100
tags:
  ValidateAllSubAccounts: 'true'
  ValidateRegions: eu-central-1
capabilities:
  - CAPABILITY_IAM
main-account-parameter: true
region: eu-central-1

eduardohki avatar Oct 30 '19 14:10 eduardohki