aws-cloudformation / cloudformation-coverage-roadmap

The AWS CloudFormation Public Coverage Roadmap
https://aws.amazon.com/cloudformation/
Creative Commons Attribution Share Alike 4.0 International
1.11k stars 56 forks source link

AWS::Route53::HostedZone - ::Id - Better behavior if not selected in Parameters #792

Open docktermj opened 3 years ago

docktermj commented 3 years ago

1. Title

AWS::Route53::HostedZone::Id - Better behavior if not selected in Parameters:

2. Scope of request

If a CloudFormation template has this Parameter:

Parameters:
  Route53HostedZoneId:
    Default: ''
    Type: AWS::Route53::HostedZone::Id

and the User does not select a Hosted Zone or if there is no Hosted Zone, there should be a way for the Cloudformation to detect this and use Condition to avoid using the Hosted Zone.

Specifically, if a user chooses a Hosted Zone, then the Cloudformation can create an HTTPS-based solution. If a Hosted Zone is not chosen, the Cloudformation can create an HTTP-based solution. For instance:

  ListenerSwaggerHttps:
    Condition: IfRoute53HostedZoneId
    Properties:
      Certificates:
        - CertificateArn: !GetAtt LambdaRunnerFindDomainName.CertificateArn
      DefaultActions:
        - TargetGroupArn: !Ref TargetGroupSwagger
          Type: forward
      LoadBalancerArn: !Ref LoadBalancerPublic
      Port: 443
      Protocol: HTTPS
    Type: AWS::ElasticLoadBalancingV2::Listener

6. Category (required) - Will help with tagging and be easier to find by other users to +1

Use the categories as displayed in the AWS Management Console (simplified):

  1. Networking & Content (VPC, Route53, API GW,...)
jlhood commented 3 years ago

@docktermj Hi and thanks for opening this issue. This sounds like a feature request for CloudFormation, but I want to confirm my understanding is correct.

Today, if you mark a template parameter with type AWS::Route53::HostedZone::Id, then CloudFormation will perform validation that the passed in value is a valid hosted zone id. However, it sounds like you also want the ability to make the parameter accept something representing "no value" as a valid value. You also want to be able to create a condition based on if a value was specified or not so you can use that condition later in your template.

Can you please confirm my understanding of your request Is correct? Thanks!

docktermj commented 3 years ago

@jlhood Your recap is correct. Essentially I want to make it easy for the user to specify a hosted zone by presenting a list, but if the user doesn't want an existing hosted zone, the user needs a way to indicate that.

I know you can do this by having a "string-base" text box, but then the user has to look up all of the hosted zones, which is less user-friendly.

jlhood commented 3 years ago

@docktermj Thanks for confirming. Since this is a feature request, I'll make sure it gets forwarded to our product team for consideration. Really appreciate the feedback!