Skip to content
This repository has been archived by the owner on Oct 17, 2024. It is now read-only.

Expressing a typed array with optional parameters #467

Open
ipmb opened this issue Jul 7, 2022 · 0 comments
Open

Expressing a typed array with optional parameters #467

ipmb opened this issue Jul 7, 2022 · 0 comments

Comments

@ipmb
Copy link

ipmb commented Jul 7, 2022

How would I express a template like this (specifically the optional array item in DomainValidationOptions)?

The type is []certificatemanager.Certificate_DomainValidationOption, but cloudformation.If returns a string

---
Parameters:
  AltDomain1:
    AllowedPattern: "^[a-z0-9\\-\\.]*$"
    Default: ''
    Description: Alternate domain 1
    Type: String
Conditions:
  AltDomain1Exists:
    Fn::Not:
    - Fn::Equals:
      - Ref: AltDomain1
      - ''
Resources:
  Certificate:
    Properties:
      DomainName:
        Ref: PrimaryDomain
      DomainValidationOptions:
      - DomainName:
          Ref: PrimaryDomain
        HostedZoneId:
          Ref: HostedZone
      - Fn::If:
        - AltDomain1Exists
        - DomainName:
            Ref: AltDomain1
          HostedZoneId:
            Ref: HostedZone
        - Ref: AWS::NoValue
      SubjectAlternativeNames:
      - Fn::If:
        - AltDomain1Exists
        - Ref: AltDomain1
        - Ref: AWS::NoValue
      Tags:
      - Key: Name
        Value:
          Ref: PrimaryDomain
      ValidationMethod: DNS
    Type: AWS::CertificateManager::Certificate
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant