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

feat: Add missing auth_string output. Fix #76 #77

Merged
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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ module "memorystore" {

| Name | Description |
|------|-------------|
| auth\_string | AUTH String set on the instance. This field will only be populated if auth\_enabled is true. |
| current\_location\_id | The current zone where the Redis endpoint is placed. |
| host | The IP address of the instance. |
| id | The memorystore instance ID. |
Expand Down
5 changes: 5 additions & 0 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,8 @@ output "persistence_iam_identity" {
description = "Cloud IAM identity used by import/export operations. Format is 'serviceAccount:'. May change over time"
value = google_redis_instance.default.persistence_iam_identity
}

output "auth_string" {
description = "AUTH String set on the instance. This field will only be populated if auth_enabled is true."
value = google_redis_instance.default.auth_string
}
1 change: 1 addition & 0 deletions test/fixtures/redis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ This test will create a new redis instance.
| location\_id | n/a |
| memory\_size\_gb | n/a |
| name | n/a |
| output\_auth\_string | n/a |
| output\_current\_location\_id | n/a |
| output\_host | n/a |
| output\_id | n/a |
Expand Down
3 changes: 3 additions & 0 deletions test/fixtures/redis/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,6 @@ output "output_current_location_id" {
value = module.memstore.current_location_id
}

output "output_auth_string" {
value = module.memstore.auth_string
}
5 changes: 5 additions & 0 deletions test/integration/redis/controls/gcloud.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
output_region = attribute('output_region')
output_host = attribute('output_host')
output_current_location_id = attribute('output_current_location_id')
output_auth_string = attribute('output_auth_string')

describe 'Outputs' do
it 'should reflect inputted variables' do
Expand All @@ -40,6 +41,10 @@
it 'should have a valid id' do
expect(output_id).to end_with name
end

it 'should have a valid auth string' do
expect(output_auth_string).to match(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/)
end
end

control 'redis-instance' do
Expand Down
3 changes: 3 additions & 0 deletions test/integration/redis/inspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ attributes:
- name: output_current_location_id
required: true
type: string
- name: output_auth_string
required: true
type: string
- name: auth_enabled
required: true
type: boolean
Expand Down