Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant