Skip to content
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

Feature request: aws_waf* data sources #2654

Closed
hegyre opened this issue Dec 13, 2017 · 10 comments
Closed

Feature request: aws_waf* data sources #2654

hegyre opened this issue Dec 13, 2017 · 10 comments
Labels
enhancement Requests to existing resources that expand the functionality or scope. new-data-source Introduces a new data source. service/waf Issues and PRs that pertain to the waf service.
Milestone

Comments

@hegyre
Copy link

hegyre commented Dec 13, 2017

Hi there,

Since WAF is global to all regions, and since my use case is to have one TF project per region, I'd love to have a data source for WAF so that we can re-use already exisiting configurations.

My use case would be especially for the ipset and regions ipset, but in fact it should be good to have it for all the waf resources.

Thx in advance.

@hegyre hegyre changed the title Feature request: awf_waf* data sources Feature request: aws_waf* data sources Dec 13, 2017
@apparentlymart apparentlymart added enhancement Requests to existing resources that expand the functionality or scope. new-data-source Introduces a new data source. labels Dec 20, 2017
@apparentlymart
Copy link
Contributor

Hi @hegyre! Thanks for this feature request.

New data sources for the WAF concepts sound like a good idea!

The Terraform team at HashiCorp won't be able to work on this in the near future due to our focus being elsewhere, but we'd be happy to review a pull request if you or someone else has the time and motivation to implement it. Alternatively, if others would also like to see this implemented I'd encourage adding a 👍 upvote reaction to the original issue comment (not to this comment), which we use as one of the inputs to prioritize work for the Terraform team.

@radeksimko radeksimko added the service/waf Issues and PRs that pertain to the waf service. label Jan 28, 2018
@erikpaasonen
Copy link
Contributor

I'd like to specifically call out a data source to query the AWS Marketplace filtered by MetricName. The use case would be to consume a specific AWS Marketplace managed rule group in a Terraform WebACL.

Also, please include aws_waf_regional*. They are similar to aws_waf* but distinct on the AWS side.

Thanks!

@flmag
Copy link

flmag commented Aug 7, 2018

Hi,

Did you already implement the feature to manage rules from marketplace ?

Thanks!

@okonon
Copy link

okonon commented Nov 2, 2018

I am wondering if you guys had a chance to work on this?

@flmag
Copy link

flmag commented Nov 5, 2018

Just subscribe with the web console to your desired marketplace package, then get the "rule id" through the url or properties.

And do something like that

resource "aws_wafregional_web_acl" "xxx-waf" {
name = "xxxx-waf"
metric_name = "XxXWaf"
default_action {
type = "ALLOW"
}
rule {
override_action {
type = "NONE"
}
type = "GROUP"
priority = 1
rule_id = "28ab067b-36c8-417e-800b-30562b732288"
}
}

@ncsurfus
Copy link

I needed to use a WebACL from a different Terraform project... and there wasn't a good way to "discover" it by name... I also didn't want to hard code it by id per account. This ended up serving me pretty well. It does depend on the aws cli.

data "external" "web-acl-id" {
  program = ["aws", "waf", "list-web-acls", "--profile", "${var.aws-profile}", "--query", "WebACLs[?Name==`${var.acl}`] | @[0]"]
}

and I can use it like....

resource "aws_cloudfront_distribution" "cloudfront" {
  ....
  web_acl_id = "${data.external.web-acl-id.result["WebACLId"]}"

@okonon
Copy link

okonon commented Nov 19, 2018

thanks @ncsurfus and @flmag that is exactly what i needed

@ryndaniels
Copy link
Contributor

Hey @hegyre 👋 - thanks again for this feature request. We've added data sources for WAF and WAFRegional rules and web ACLs in v.2.20.0, and for IP sets in v2.21.0 of the AWS Terraform Provider, which should be released at the end of this week. We're going to go ahead and close this issue now that we have completed the IP sets support, but if there are additional data sources that you need in the future, please feel free to create new specific issues for each of them. 😃

@bflad
Copy link
Contributor

bflad commented Jul 26, 2019

This has been released in version 2.21.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests, documentation updates, or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@ghost
Copy link

ghost commented Nov 2, 2019

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Nov 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. new-data-source Introduces a new data source. service/waf Issues and PRs that pertain to the waf service.
Projects
None yet
Development

No branches or pull requests

9 participants