-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Use security groups modules. Get: One of ['cidr_blocks', 'ipv6_cidr_blocks', 'self', 'source_security_group_id', 'prefix_list_ids'] must be set to create an AWS Security Group Rule #65
Comments
Glad that you like these modules. The error you are receiving is because you are creating named security group, which means it open some ports and it requires explicit specification of CIDR blocks (or other properties as listed in the error) to be associated with those ports. Normally you specify CIDR blocks like this: module "web_security_group" {
source = "terraform-aws-modules/security-group/aws//modules/web"
name = "web_security_group"
vpc_id = "${module.vpc.vpc_id}"
ingress_cidr_blocks = ["0.0.0.0/0"]
} |
@antonbabenko Thanks for your explanation, but there are things I am not quite clear. I try to create this sg according to its documentation. Since Or do I just misunderstood something? I guess I should add |
In fact, those arguments are marked as optional because they can be defined in a variety of combinations so that at least one is required.
|
I solve the issue and understand the idea of your module. |
In case you'd like to create a security group without specifying a CIDR range, add
under the Note that you might want to change the |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
I'm using your awesome modules to build up my infrastructure. However, I have issue while setting up security groups.
I have setup VPC by using https://github.com/terraform-aws-modules/terraform-aws-vpc
And I use this module to setup security groups, but I get error messages like this:
This is my tf file. I haven't put many things yet. And I guess, the
ingress_rules
if I don't set anything specifically, are those values in error messages set by default in the auto_values.tf ?The text was updated successfully, but these errors were encountered: