aws-cloudformation / aws-cloudformation-templates

A collection of useful CloudFormation templates
Apache License 2.0
4.7k stars 4.28k forks source link

Fix: Replace SecurityGroups with SecurityGroupIds in YAML template #451

Closed katsuhisa91 closed 2 months ago

katsuhisa91 commented 2 months ago

Overview

This PR addresses the same issue as identified in [PR #450], where using groupName (security group name) alongside the subnet parameter in the EC2 instance configuration results in an error. The CloudFormation YAML template has been updated to reference security groups by ID instead of name.

Changes

Background

Similar to the changes made in PR #hoge, the AWS EC2 API does not allow the use of groupName (security group name) with a subnet parameter. Instead, security groups must be referenced by their ID, which is the focus of this fix.

Testing

The updated CloudFormation YAML template was successfully validated, and EC2 instance creation proceeded without errors.