AWSTemplateFormatVersion: '2010-09-09'
Description: Associations for {{portfolio.DisplayName}}

Conditions:
  NoOpCondition: !Equals [ true, false]

Resources:
  NoOpResource:
    Type: AWS::S3::Bucket
    Description: Resource to ensure that template contains a resource even when there are no shares
    Condition: NoOpCondition

{% for association in portfolio.Associations %}
  Association{{ loop.index }}:
    Type: AWS::ServiceCatalog::PortfolioPrincipalAssociation
    Properties:
      PrincipalARN: !Sub "{{ association }}"
      PortfolioId: {{ portfolio_id }}
      PrincipalType: IAM{% endfor %}
