-
Notifications
You must be signed in to change notification settings - Fork 59
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
Write Terraform CLI logs to container stdout #258
Merged
bobh66
merged 16 commits into
upbound:main
from
suvaanshkumar:support-terraform-cli-log
Aug 23, 2024
Merged
Changes from 13 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
f398102
Add spec.enablelogging to workspace
suvaanshkumar 6f75564
Send Workspace spec.enableLogging to Terraform Harness
katronquillo d32e489
Add logic to send Terraform Plan output to container logs
katronquillo 34d4ba1
Revert example providerconfig
suvaanshkumar f4099a0
Log structurally in json format
suvaanshkumar 3b8fc51
Refactor enableTerraformCLILogging flag, Fix time formattting for log…
suvaanshkumar c8a5bca
updated documentation and fix lint errors
6541019
Restructure workspace to add enableterraformlogs to forprovider
suvaanshkumar 36ee6e7
Revert providerconfig
suvaanshkumar 4bf2de0
Made EnableTerraformCLILogging Optional and added a description. Adde…
ramiradaideh 1d2cf22
Reverting WhiteSpace changes
ramiradaideh e0aab2c
replaced newline at end of providerconfig.yaml
tammy-young a5ec521
Show operation on error
tammy-young 04387b3
Revert logging format changes
tammy-young be140a3
Change Terraform destroy logging message
tammy-young 2817806
Fix unformatted file
tammy-young File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
apiVersion: tf.upbound.io/v1beta1 | ||
kind: Workspace | ||
metadata: | ||
name: example-random-generator | ||
annotations: | ||
meta.upbound.io/example-id: tf/v1beta1/workspace | ||
# The terraform workspace will be named 'random'. If you omit this | ||
# annotation it would be derived from metadata.name - e.g. 'example-random-generator. | ||
crossplane.io/external-name: random | ||
spec: | ||
forProvider: | ||
enableTerraformCLILogging: true | ||
source: Inline | ||
module: | | ||
resource "random_id" "example_id" { | ||
byte_length = 8 | ||
} | ||
resource "random_password" "password" { | ||
length = 16 | ||
special = true | ||
} | ||
// Non-sensitive Outputs are written to status.atProvider.outputs and to the connection secret. | ||
output "random_id_hex" { | ||
value = random_id.example_id.hex | ||
} | ||
// Sensitive Outputs are only written to the connection secret | ||
output "random_password" { | ||
value = random_password.password | ||
sensitive = true | ||
} | ||
// Terraform has several other random resources, see the random provider for details | ||
writeConnectionSecretToRef: | ||
namespace: default | ||
name: terraform-workspace-example-random-generator |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I agree that the logging format change should be in a separate PR and should be able to be specified as a runtime argument. It should default to the current format to prevent breaking existing deployments and allow for a json option to be specified. If we want to change the default log format in the future we can plan for it and announce it ahead of time, but for now I think it's better not to change the default format.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @bobh66, we reverted the changes for the logging format. Please review them when you get the chance and let us know if you require anything else to get this PR merged!