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 42 forks source link

Regions parameter in defaults section of manifest file failed with None error #547

Closed shydhanya closed 2 years ago

shydhanya commented 2 years ago

Puppet pipeline fails if I have regions_enabled or default_region in defaults: section of the file. I am using puppet version 0.175.0

However, it works fine if I move these 2 parameters to accounts: section. I am copying these 2 parameters across 65+ accountid in production.

I tried to reproduce the same issue in Dev account with same version, unfortunately this issue is not occurring in development account.

Could you please help to fix this problem?


> File   "*root*.pyenv*versions*3.7.13*lib*python3.7*site-packages*servicecatalog_puppet*manifest_utils.py",   line 1237, in get_account_ids_and_regions_used_for_section_item
> 
> for   task in self.get_tasks_for(puppet_account_id, section_name, item_name):
> File   "*root*.pyenv*versions*3.7.13*lib*python3.7*site-packages*servicecatalog_puppet*manifest_utils.py",   line 958, in get_tasks_for
> for region_enabled in   account.get("regions_enabled"):
> TypeError: 'NoneType' object is not   iterable
eamonnfaherty commented 2 years ago

Can you please share your manifest file.

shydhanya commented 2 years ago
image
eamonnfaherty commented 2 years ago

the following works in 0.186.0:

defaults:
  accounts:
    default_region: "eu-west-1"
    regions_enabled:
      - "eu-west-1"
      - "eu-west-2"
      - "eu-west-3"
      - "us-west-1"
      - "us-east-1"

accounts:
  - account_id: "${AWS::PuppetAccountId}"
    name: "puppet-account"
    tags:
      - "role:sct"
shydhanya commented 2 years ago

Thankyou. Worked as expected.