Skip to content

google_cloud_run_v2_service - containers required, but not documented #20509

Open
@bchadwic

Description

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 an issue is assigned to a user, that user is claiming responsibility for the issue.
  • Customers working with a Google Technical Account Manager or Customer Engineer can ask them to reach out internally to expedite investigation and resolution of this issue.

Terraform Version & Provider Version(s)

Terraform v6.12.0

Affected Resource(s)

google_cloud_run_v2_service

Terraform Configuration

resource "google_cloud_run_v2_service" "default" {
  name     = "cloudrun-service2"
  project  = var.project
  location = "us-central1"
  template {
      service_account = var.service_account
  }
}

Debug Output

N/A

Expected Behavior

The documentation for cloud_run_v2_service states that the containers block is Optional.

I would expect that I would be able to deploy a cloud_run_v2_service without a containers block based on the documentation.

Actual Behavior

When deploying the code above, I get this error:

╷
│ Error: Error creating Service: googleapi: Error 400: Violation in CreateServiceRequest.service.template.containers: Revision template must contain at least one container.
│ Details:
│ [
│   {
│     "@type": "type.googleapis.com/google.rpc.BadRequest",
│     "fieldViolations": [
│       {
│         "description": "Revision template must contain at least one container.",
│         "field": "Violation in CreateServiceRequest.service.template.containers"
│       }
│     ]
│   }
│ ]
│ 
│   with google_cloud_run_v2_service.default,
│   on main.tf line 32, in resource "google_cloud_run_v2_service" "default":
│   32: resource "google_cloud_run_v2_service" "default" {
│ 
╵

Steps to reproduce

  1. terraform apply

Important Factoids

The documentation for the previous cloud_run_service resource states that containers are Required, so I'm assuming the mistake is within the cloud_run_v2_service documentation.

I understand that this may not be a bug with cloud_run_v2_service resource, but more so just a problem with the documentation. I can create a pr to update the documentation if this is the case.

References

No response

b/381438826

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions