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

Fix E2E tests #2699

Merged
merged 1 commit into from
Nov 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions modules/cloud-run-v2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ module "cloud_run" {
}
}
}
deletion_protection = false
}
# tftest inventory=gcs-mount.yaml e2e
```
Expand Down
8 changes: 4 additions & 4 deletions modules/iam-service-account/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ module "myproject-default-service-accounts" {
| [email](outputs.tf#L17) | Service account email. | |
| [iam_email](outputs.tf#L25) | IAM-format service account email. | |
| [id](outputs.tf#L33) | Fully qualified service account id. | |
| [key](outputs.tf#L42) | Service account key. | ✓ |
| [name](outputs.tf#L48) | Service account name. | |
| [service_account](outputs.tf#L57) | Service account resource. | |
| [service_account_credentials](outputs.tf#L62) | Service account json credential templates for uploaded public keys data. | |
| [key](outputs.tf#L41) | Service account key. | ✓ |
| [name](outputs.tf#L47) | Service account name. | |
| [service_account](outputs.tf#L55) | Service account resource. | |
| [service_account_credentials](outputs.tf#L60) | Service account json credential templates for uploaded public keys data. | |
<!-- END TFDOC -->
10 changes: 4 additions & 6 deletions modules/iam-service-account/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,23 @@ output "email" {
description = "Service account email."
value = local.resource_email_static
depends_on = [
local.service_account
local.service_account,
]
}

output "iam_email" {
description = "IAM-format service account email."
value = local.resource_iam_email_static
depends_on = [
local.service_account
local.service_account,
]
}

output "id" {
description = "Fully qualified service account id."
value = local.service_account_id_static
depends_on = [
data.google_service_account.service_account,
google_service_account.service_account
local.service_account,
]
}

Expand All @@ -49,8 +48,7 @@ output "name" {
description = "Service account name."
value = local.service_account_id_static
depends_on = [
data.google_service_account.service_account,
google_service_account.service_account
local.service_account,
]
}

Expand Down
10 changes: 9 additions & 1 deletion modules/pubsub/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,11 @@ module "iam-service-account" {
source = "./fabric/modules/iam-service-account"
project_id = var.project_id
name = "fixture-service-account"
iam_project_roles = {
"${var.project_id}" = [
"roles/bigquery.dataEditor",
]
}
}

module "pubsub" {
Expand All @@ -152,8 +157,11 @@ module "pubsub" {
}
}
}
depends_on = [
module.iam-service-account # wait for IAM grants to finish
]
}
# tftest modules=3 resources=6 fixtures=fixtures/bigquery-dataset.tf inventory=bigquery-subscription-with-service-account.yaml e2e
# tftest fixtures=fixtures/bigquery-dataset.tf inventory=bigquery-subscription-with-service-account.yaml e2e
```

## Cloud Storage subscriptions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
# limitations under the License.

values:
module.iam-service-account.google_project_iam_member.project-roles["project-id-roles/bigquery.dataEditor"]:
project: project-id
role: roles/bigquery.dataEditor
module.iam-service-account.google_service_account.service_account[0]:
account_id: fixture-service-account
project: project-id
module.pubsub.google_pubsub_subscription.default["test-bigquery-with-service-account"]:
bigquery_config:
- drop_unknown_fields: false
Expand All @@ -23,8 +29,6 @@ values:
write_metadata: false
cloud_storage_config: []
dead_letter_policy: []
effective_labels:
goog-terraform-provisioned: 'true'
enable_exactly_once_delivery: false
enable_message_ordering: false
filter: null
Expand All @@ -35,30 +39,19 @@ values:
push_config: []
retain_acked_messages: false
retry_policy: []
terraform_labels:
goog-terraform-provisioned: 'true'
timeouts: null
topic: my-topic
module.pubsub.google_pubsub_topic.default:
effective_labels:
goog-terraform-provisioned: 'true'
ingestion_data_source_settings: []
kms_key_name: null
labels: null
message_retention_duration: null
name: my-topic
project: project-id
schema_settings: []
terraform_labels:
goog-terraform-provisioned: 'true'
timeouts: null

counts:
google_bigquery_dataset: 1
google_bigquery_dataset_iam_binding: 1
google_bigquery_table: 1
google_project_iam_member: 1
google_pubsub_subscription: 1
google_pubsub_topic: 1
google_service_account: 1
modules: 3
resources: 6