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

Add support for GCP PubSub Subscription filter #6727

Comments

@brachipa
Copy link

brachipa commented Jul 1, 2020

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment. If the issue is assigned to the "modular-magician" user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If the issue is assigned to a user, that user is claiming responsibility for the issue. If the issue is assigned to "hashibot", a community member has claimed the issue already.

Description

In GCP PubSub there is new feature filters

it will be very helpful if you support it, since it is useful feature in PubSub.
I cab't create the PubSub in TF and then add the filter since the filter can't be set after subscription is created.

New or Affected Resource(s)

  • google_PubSub

Potential Terraform Configuration

resource "google_pubsub_topic" "example" {
  name = "example-topic"
}

resource "google_pubsub_subscription" "example" {
  name  = "example-subscription"
  topic = google_pubsub_topic.example.name

  labels = {
    foo = "bar"
  }

  # 20 minutes
  message_retention_duration = "1200s"
  retain_acked_messages      = true

  ack_deadline_seconds = 20

  expiration_policy {
    ttl = "300000.5s"
  }

 filter="attributes:domain"
--


"

}

References

@ghost ghost added the enhancement label Jul 1, 2020
@tim-codes
Copy link
Contributor

Looking to contribute to this issue however getting a bit confused by the source code. I can see that the resource is generated by magic modules as it has the "AUTO GENERATED CODE" warning in the source file. However, following the contribution guide and the link to this repository I'm unable to find the corresponding code for the pubsub subscription.

@danawillow danawillow added this to the Goals milestone Jul 7, 2020
@danawillow
Copy link
Contributor

@tim-codes the third_party folder only has the non-generated resources. Since pubsub is generated, its definition lives at https://github.com/GoogleCloudPlatform/magic-modules/tree/master/products/pubsub (api.yaml and terraform.yaml). I'd also recommend reading through the README/codelab to get a sense of how to do things in MM, but happy to have you help out with this! Thanks!

AlbertSabate added a commit to AlbertSabate/magic-modules that referenced this issue Jul 21, 2020
slevenick pushed a commit to GoogleCloudPlatform/magic-modules that referenced this issue Aug 11, 2020
* Add new field filter to pubsub.

Fixes: hashicorp/terraform-provider-google#6727

* Fixed filter name, it was improperly set.

* add filter key to pubsub subscription unit test

* spaces not tabs!

* hardcode filter value in test

* revert remove escaped quotes

Co-authored-by: Tim O'Connell <hi@timoconnell.co.uk>
modular-magician added a commit to modular-magician/inspec-gcp that referenced this issue Aug 11, 2020
* Add new field filter to pubsub.

Fixes: hashicorp/terraform-provider-google#6727

* Fixed filter name, it was improperly set.

* add filter key to pubsub subscription unit test

* spaces not tabs!

* hardcode filter value in test

* revert remove escaped quotes

Co-authored-by: Tim O'Connell <hi@timoconnell.co.uk>
Signed-off-by: Modular Magician <magic-modules@google.com>
modular-magician added a commit to modular-magician/inspec-gcp that referenced this issue Aug 11, 2020
* Add new field filter to pubsub.

Fixes: hashicorp/terraform-provider-google#6727

* Fixed filter name, it was improperly set.

* add filter key to pubsub subscription unit test

* spaces not tabs!

* hardcode filter value in test

* revert remove escaped quotes

Co-authored-by: Tim O'Connell <hi@timoconnell.co.uk>
Signed-off-by: Modular Magician <magic-modules@google.com>

Co-authored-by: Tim O'Connell <hi@timoconnell.co.uk>
modular-magician added a commit to modular-magician/terraform-google-conversion that referenced this issue Aug 11, 2020
* Add new field filter to pubsub.

Fixes: hashicorp/terraform-provider-google#6727

* Fixed filter name, it was improperly set.

* add filter key to pubsub subscription unit test

* spaces not tabs!

* hardcode filter value in test

* revert remove escaped quotes

Co-authored-by: Tim O'Connell <hi@timoconnell.co.uk>
Signed-off-by: Modular Magician <magic-modules@google.com>
modular-magician added a commit to GoogleCloudPlatform/terraform-google-conversion that referenced this issue Aug 11, 2020
* Add new field filter to pubsub.

Fixes: hashicorp/terraform-provider-google#6727

* Fixed filter name, it was improperly set.

* add filter key to pubsub subscription unit test

* spaces not tabs!

* hardcode filter value in test

* revert remove escaped quotes

Co-authored-by: Tim O'Connell <hi@timoconnell.co.uk>
Signed-off-by: Modular Magician <magic-modules@google.com>

Co-authored-by: Tim O'Connell <hi@timoconnell.co.uk>
modular-magician added a commit to modular-magician/google.cloud that referenced this issue Aug 11, 2020
* Add new field filter to pubsub.

Fixes: hashicorp/terraform-provider-google#6727

* Fixed filter name, it was improperly set.

* add filter key to pubsub subscription unit test

* spaces not tabs!

* hardcode filter value in test

* revert remove escaped quotes

Co-authored-by: Tim O'Connell <hi@timoconnell.co.uk>
Signed-off-by: Modular Magician <magic-modules@google.com>
modular-magician added a commit to ansible-collections/google.cloud that referenced this issue Aug 11, 2020
* Add new field filter to pubsub.

Fixes: hashicorp/terraform-provider-google#6727

* Fixed filter name, it was improperly set.

* add filter key to pubsub subscription unit test

* spaces not tabs!

* hardcode filter value in test

* revert remove escaped quotes

Co-authored-by: Tim O'Connell <hi@timoconnell.co.uk>
Signed-off-by: Modular Magician <magic-modules@google.com>

Co-authored-by: Tim O'Connell <hi@timoconnell.co.uk>
modular-magician added a commit to modular-magician/terraform-provider-google that referenced this issue Aug 11, 2020
* Add new field filter to pubsub.

Fixes: hashicorp#6727

* Fixed filter name, it was improperly set.

* add filter key to pubsub subscription unit test

* spaces not tabs!

* hardcode filter value in test

* revert remove escaped quotes

Co-authored-by: Tim O'Connell <hi@timoconnell.co.uk>
Signed-off-by: Modular Magician <magic-modules@google.com>
modular-magician added a commit that referenced this issue Aug 11, 2020
* Add new field filter to pubsub.

Fixes: #6727

* Fixed filter name, it was improperly set.

* add filter key to pubsub subscription unit test

* spaces not tabs!

* hardcode filter value in test

* revert remove escaped quotes

Co-authored-by: Tim O'Connell <hi@timoconnell.co.uk>
Signed-off-by: Modular Magician <magic-modules@google.com>

Co-authored-by: Tim O'Connell <hi@timoconnell.co.uk>
modular-magician added a commit to modular-magician/terraform-provider-google-beta that referenced this issue Aug 11, 2020
* Add new field filter to pubsub.

Fixes: hashicorp/terraform-provider-google#6727

* Fixed filter name, it was improperly set.

* add filter key to pubsub subscription unit test

* spaces not tabs!

* hardcode filter value in test

* revert remove escaped quotes

Co-authored-by: Tim O'Connell <hi@timoconnell.co.uk>
Signed-off-by: Modular Magician <magic-modules@google.com>
modular-magician added a commit to hashicorp/terraform-provider-google-beta that referenced this issue Aug 11, 2020
* Add new field filter to pubsub.

Fixes: hashicorp/terraform-provider-google#6727

* Fixed filter name, it was improperly set.

* add filter key to pubsub subscription unit test

* spaces not tabs!

* hardcode filter value in test

* revert remove escaped quotes

Co-authored-by: Tim O'Connell <hi@timoconnell.co.uk>
Signed-off-by: Modular Magician <magic-modules@google.com>

Co-authored-by: Tim O'Connell <hi@timoconnell.co.uk>
@ghost
Copy link

ghost commented Sep 11, 2020

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. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked and limited conversation to collaborators Sep 11, 2020
skpaterson pushed a commit to inspec/inspec-gcp that referenced this issue Sep 29, 2020
* fix typo (#3369) (#413)

Signed-off-by: Modular Magician <magic-modules@google.com>

* Fix check for serial port disabled (#3695) (#415)

* Fix check for serial port disabled

* fix check for block-project-ssh-keys

Signed-off-by: Modular Magician <magic-modules@google.com>

* Add mode enum and scale down controls for Compute AutoScaler (#3693) (#416)

* Add mode enum and scale down controls for Compute AutoScaler

* Add mode enum for Compute AutoScaler in the correct API block

* Add defaults for mode and default_from_api for scale down controls

* Add tests for scale_down_controls and set at_least_one_of for it

Signed-off-by: Modular Magician <magic-modules@google.com>

* added support for shielded nodes in container (#3639) (#417)

Signed-off-by: Modular Magician <magic-modules@google.com>

* fix memcache_parameters (#3733) (#418)

* change memcacheParameters to parameters, add parameters to basic test

* make switching memcacheParameters to parameters not a breaking-change

Signed-off-by: Modular Magician <magic-modules@google.com>

* add tiers and nfs_export_options (#3766) (#419)

* add tiers and nfs_export_options

* update docs, make full test beta

Signed-off-by: Modular Magician <magic-modules@google.com>

* Add skip enum value generation (#3767) (#420)

* Add skip enum value generation

* Fix default

* Fix reader

* Fix line spacing on enum values

Signed-off-by: Modular Magician <magic-modules@google.com>

* Backend service support for internet NEG backend (#3782) (#421)

* Add ability to set global network endpoint group as backend for backend service. Make health_checks optional

* PR fixes

* Add encoder to remove max_utilization when neg backend

* Check for global NEG in group to remove max_utilization

* Add another nil check

* Spacing

* Docs fix

Signed-off-by: Modular Magician <magic-modules@google.com>

* add firewall logging controls (#3780) (#422)

* add firewall logging controls

* make backward compatible

* check enable_logging in expand

* update docs

* update expand logic to fix failing test

Signed-off-by: Modular Magician <magic-modules@google.com>

* Fix colon in doc notes (#3796) (#423)

Signed-off-by: Modular Magician <magic-modules@google.com>

* Add persistence_iam_identity to Redis Instance (#3805) (#424)

Signed-off-by: Modular Magician <magic-modules@google.com>

* Org Security Policies (Hierarchical Firewalls) (#3626) (#425)

Co-authored-by: Dana Hoffman <danahoffman@google.com>
Signed-off-by: Modular Magician <magic-modules@google.com>

Co-authored-by: Dana Hoffman <danahoffman@google.com>

* Adding Missing Cloud Build Attributes (#3627) (#426)

Signed-off-by: Modular Magician <magic-modules@google.com>

* Add additional fields to Memcached Instance (#3821) (#427)

Signed-off-by: Modular Magician <magic-modules@google.com>

* Convert inboundServices to an enum. (#3820) (#428)

Signed-off-by: Modular Magician <magic-modules@google.com>

* add source_image and source_snapshot to google_compute_image (#3799) (#429)

* add source_image to google_compute_image

* add source_snapshot to google_compute_image

* PR comment changes

Signed-off-by: Modular Magician <magic-modules@google.com>

* Collection fixes for release (#3831) (#430)

Signed-off-by: Modular Magician <magic-modules@google.com>

* Add new field filter to pubsub. (#3759) (#431)

* Add new field filter to pubsub.

Fixes: hashicorp/terraform-provider-google#6727

* Fixed filter name, it was improperly set.

* add filter key to pubsub subscription unit test

* spaces not tabs!

* hardcode filter value in test

* revert remove escaped quotes

Co-authored-by: Tim O'Connell <hi@timoconnell.co.uk>
Signed-off-by: Modular Magician <magic-modules@google.com>

Co-authored-by: Tim O'Connell <hi@timoconnell.co.uk>

* Add archive class to gcs (#3867) (#432)

Signed-off-by: Modular Magician <magic-modules@google.com>

* Add support for gRPC healthchecks (#3825) (#433)

Signed-off-by: Modular Magician <magic-modules@google.com>

* Add enableMessageOrdering to Pub/Sub Subscription (#3872) (#434)

Add enableMessageOrdering to Pub/Sub Subscription

Signed-off-by: Modular Magician <magic-modules@google.com>

* Specify possible values for arg only once (#3874) (#435)

Signed-off-by: ialidzhikov <i.alidjikov@gmail.com>
Signed-off-by: Modular Magician <magic-modules@google.com>

* use {product}.googleapis.com endpoints (#3755) (#436)

* use {product}.googleapis.com endpoints

* use actual correct urls

* fix zone data source test

* fix network peering tests

* possibly fix deleting default network

Signed-off-by: Modular Magician <magic-modules@google.com>

* Add vpcAccessConnector property on google_app_engine_standard_app_version terraform resource (#3789) (#437)

* add vpc access connector property in standard app version resource

* add Gemfile.lock and .ruby-version

* modify .ruby-version

* Update Gemfile.lock

* Update Gemfile.lock

* Update Gemfile.lock

* add test for vpcAccessConnector field

* change casing of test field

* add comma

* format app engine connector test

* make vpc_access_connector an object

* add vpc access connector resource to test

* pass connector id output property to app engine resource instead of hardcoding connector id

Signed-off-by: Modular Magician <magic-modules@google.com>

* retrypolicy attribute added (#3843) (#438)

* retrypolicy attribute added

* test case updated

Signed-off-by: Modular Magician <magic-modules@google.com>

* add discovery endpoint (#3891) (#439)

Signed-off-by: Modular Magician <magic-modules@google.com>

* Advanced logging config options in google_compute_subnetwork (#3603) (#440)

Co-authored-by: Dana Hoffman <danahoffman@google.com>
Signed-off-by: Modular Magician <magic-modules@google.com>

Co-authored-by: Dana Hoffman <danahoffman@google.com>

* Add Erase Windows VSS support to compute disk (#3898) (#441)

Co-authored-by: Cameron Thornton <camthornton@google.com>
Signed-off-by: Modular Magician <magic-modules@google.com>

Co-authored-by: Cameron Thornton <camthornton@google.com>

* Add Snapshot location to compute snapshot (#3896) (#442)

* added storage locations

* add storage locations to field

* tweak cmek logic

* fix the decoder logic and cleanup whitespaces

* remove duplicate entry

Signed-off-by: Modular Magician <magic-modules@google.com>

* Added missing 'all' option for protocol firewall rule (#3962) (#443)

Signed-off-by: Modular Magician <magic-modules@google.com>

* Revert `eraseWindowsVssSignature` field and test (#3959) (#444)

Signed-off-by: Modular Magician <magic-modules@google.com>

* Added support GRPC for google_compute_(region)_backend_service.protocol (#3973) (#445)

Co-authored-by: Edward Sun <sunedward@google.com>
Signed-off-by: Modular Magician <magic-modules@google.com>

Co-authored-by: Edward Sun <sunedward@google.com>

* Added properties of options & artifacts on google_cloudbuild_trigger (#3944) (#446)

* added options & artifacts to cloudbuild trigger

* updated with minor changes and added more options in test

* a test adding update behavior for multiple optional fields

Co-authored-by: Edward Sun <sunedward@google.com>
Signed-off-by: Modular Magician <magic-modules@google.com>

Co-authored-by: Edward Sun <sunedward@google.com>

* products/container: Add datapath provider field (#3956) (#447)

Signed-off-by: Modular Magician <magic-modules@google.com>

* Add SEV_CAPABLE option to google_compute_image (#3994) (#448)

Signed-off-by: Modular Magician <magic-modules@google.com>

* Add network peerings for inspec (#4002) (#449)

Signed-off-by: Modular Magician <magic-modules@google.com>

* Update docs for pubsub targets in cloud scheduler (#4008) (#450)

Signed-off-by: Modular Magician <magic-modules@google.com>

Co-authored-by: The Magician <magic-modules@google.com>
Co-authored-by: Dana Hoffman <danahoffman@google.com>
Co-authored-by: Tim O'Connell <hi@timoconnell.co.uk>
Co-authored-by: Cameron Thornton <camthornton@google.com>
Co-authored-by: Edward Sun <sunedward@google.com>
Co-authored-by: Stuart Paterson <spaterson@chef.io>
modular-magician added a commit to ansible-collections/google.cloud that referenced this issue Oct 6, 2020
* Make `iap` field computed (#3814) (#272)

Signed-off-by: Modular Magician <magic-modules@google.com>

* add source_image and source_snapshot to google_compute_image (#3799) (#273)

* add source_image to google_compute_image

* add source_snapshot to google_compute_image

* PR comment changes

Signed-off-by: Modular Magician <magic-modules@google.com>

* Collection fixes for release (#3831) (#274)

Signed-off-by: Modular Magician <magic-modules@google.com>

* Add new field filter to pubsub. (#3759) (#275)

* Add new field filter to pubsub.

Fixes: hashicorp/terraform-provider-google#6727

* Fixed filter name, it was improperly set.

* add filter key to pubsub subscription unit test

* spaces not tabs!

* hardcode filter value in test

* revert remove escaped quotes

Co-authored-by: Tim O'Connell <hi@timoconnell.co.uk>
Signed-off-by: Modular Magician <magic-modules@google.com>

Co-authored-by: Tim O'Connell <hi@timoconnell.co.uk>

* Add archive class to gcs (#3867) (#276)

Signed-off-by: Modular Magician <magic-modules@google.com>

* Add support for gRPC healthchecks (#3825) (#277)

Signed-off-by: Modular Magician <magic-modules@google.com>

* Add enableMessageOrdering to Pub/Sub Subscription (#3872) (#278)

Add enableMessageOrdering to Pub/Sub Subscription

Signed-off-by: Modular Magician <magic-modules@google.com>

* use {product}.googleapis.com endpoints (#3755) (#279)

* use {product}.googleapis.com endpoints

* use actual correct urls

* fix zone data source test

* fix network peering tests

* possibly fix deleting default network

Signed-off-by: Modular Magician <magic-modules@google.com>

* Removed instances where input and output are both true (#3890) (#280)

* [provider-yaml] - Removed instances where input and output are both true

* modified to only supply output. Following pattern from bigquerydatatransfer

Co-authored-by: Scott Suarez <scottsuarez@google.com>
Signed-off-by: Modular Magician <magic-modules@google.com>

Co-authored-by: Scott Suarez <scottsuarez@google.com>

* retrypolicy attribute added (#3843) (#281)

* retrypolicy attribute added

* test case updated

Signed-off-by: Modular Magician <magic-modules@google.com>

* Advanced logging config options in google_compute_subnetwork (#3603) (#282)

Co-authored-by: Dana Hoffman <danahoffman@google.com>
Signed-off-by: Modular Magician <magic-modules@google.com>

Co-authored-by: Dana Hoffman <danahoffman@google.com>

* Add Erase Windows VSS support to compute disk (#3898) (#283)

Co-authored-by: Cameron Thornton <camthornton@google.com>
Signed-off-by: Modular Magician <magic-modules@google.com>

Co-authored-by: Cameron Thornton <camthornton@google.com>

* Add Snapshot location to compute snapshot (#3896) (#286)

* added storage locations

* add storage locations to field

* tweak cmek logic

* fix the decoder logic and cleanup whitespaces

* remove duplicate entry

Signed-off-by: Modular Magician <magic-modules@google.com>

* Added missing 'all' option for protocol firewall rule (#3962) (#287)

Signed-off-by: Modular Magician <magic-modules@google.com>

* Added support GRPC for google_compute_(region)_backend_service.protocol (#3973) (#289)

Co-authored-by: Edward Sun <sunedward@google.com>
Signed-off-by: Modular Magician <magic-modules@google.com>

Co-authored-by: Edward Sun <sunedward@google.com>

* Add schema update support to spanner db 2082 (#3947) (#291)

* eoncders and customdiff added for spanner DB ddl update

* config update test case added

* customdiff modified to handle out-of-index issue

* new lines added

* indent fixed

* indent fixed for tests

* test added for ddl update condition

* mock added Terraformresourcediff, unit tests added

* test fixed

* more unit tests added

* tests fixed

* PR comments implemented

* unit tests converted to table driven tests

* ImportStateVerifyIgnore flag added to tests

* syntax corrected in test

Signed-off-by: Modular Magician <magic-modules@google.com>

* Added properties of options & artifacts on google_cloudbuild_trigger (#3944) (#292)

* added options & artifacts to cloudbuild trigger

* updated with minor changes and added more options in test

* a test adding update behavior for multiple optional fields

Co-authored-by: Edward Sun <sunedward@google.com>
Signed-off-by: Modular Magician <magic-modules@google.com>

Co-authored-by: Edward Sun <sunedward@google.com>

* Enable TPUs to use Shared VPC (#3939) (#293)

* add support for shared vpc

* make cidr_block computable

* add diffsuppression

* tweak diffsupression to ignore when network has a change

* rework diffsupress

* add customizediff

* switch the diff checks

Signed-off-by: Modular Magician <magic-modules@google.com>

* Add SEV_CAPABLE option to google_compute_image (#3994) (#294)

Signed-off-by: Modular Magician <magic-modules@google.com>

* Update docs for pubsub targets in cloud scheduler (#4008) (#295)

Signed-off-by: Modular Magician <magic-modules@google.com>

* Make RegionBackendService health checks optional (#4053) (#297)

Signed-off-by: Modular Magician <magic-modules@google.com>

* Update terminology for IAM roles (#4056) (#299)

Roles like "Owner" and "Editor" are now called "basic roles": https://cloud.google.com/iam/docs/understand

Signed-off-by: Modular Magician <magic-modules@google.com>

* Add source snapshot to ansible (#4060)

Signed-off-by: Modular Magician <magic-modules@google.com>

Co-authored-by: Tim O'Connell <hi@timoconnell.co.uk>
Co-authored-by: Scott Suarez <scottsuarez@google.com>
Co-authored-by: Dana Hoffman <danahoffman@google.com>
Co-authored-by: Cameron Thornton <camthornton@google.com>
Co-authored-by: Edward Sun <sunedward@google.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.