amazon web services - Terraform throws "groupName cannot be used with the parameter subnet" or "VPC security groups may not be used for a non-VPC launch" -
when trying figure out how configure aws_instance
aws vpc following errors occur:
* error launching source instance: invalidparametercombination: parameter groupname cannot used parameter subnet status code: 400, request id: []
or
* error launching source instance: invalidparametercombination: vpc security groups may not used non-vpc launch status code: 400, request id: []
this due how security group associated instance.
without subnet ok associate using security group's name:
resource "aws_instance" "server" { ... security_groups = [ "${aws_security_group.group_name.name}" ] }
in case subnet associated cannot use name, should instead use security group's id:
security_groups = [ "${aws_security_group.group_name.id}" ] subnet_id = "${aws_subnet.subnet_name.id}"
the above assumes you've created security group named group_name
, , subnet named subnet_name
Comments
Post a Comment