aws-samples / amazon-ec2-nice-dcv-samples

AWS CloudFormation templates to provision Linux or Windows EC2 instances with GUI running NICE DCV remote display server. Includes option to install GPU drivers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Stack creation fails with "Attribute: PublicIp was not found for resource" when assignStaticIP parameter is "No"

elduds opened this issue · comments

Value: !Sub "https://${ec2Instance.PublicIp}:${listenPort}"

Suggest adding a condition to the output eg.

  DCVwebConsole:
    Condition: useElasticIP
    Description: DCV web console (login as ec2-user)
    Value: !Sub "https://${ec2Instance.PublicIp}:${listenPort}"

Thanks for the report.

Stack creation fails as your EC2 is not provisioned in a public subnet, i.e. it does not have a public IP.
For EC2 in public subnet, assignStaticIP provides option to associate a static internet IP via Elastic IP.

As per EC2 instance in private subnet, you can either remove or comment out the last 3 lines in yaml file.

Add displayPublicIP CloudFormation parameter. Set this to No if EC2 has no public IP.
Editing of template file is no longer required.