Skip to content

Conversation

fujiwara
Copy link
Owner

@fujiwara fujiwara commented Feb 7, 2025

This pull request includes several changes to add support for custom S3 endpoints and improve testing capabilities. The most important changes include updates to the workflow configuration, the main application logic, and the S3 state reading functionality.

Workflow Configuration:

  • .github/workflows/test.yml: Updated the Go version matrix to include 1.23 and added MinIO service configuration for local S3 testing. Environment variables for MinIO are also set for the build and test steps. [1] [2]

Application Logic:

  • cmd/tfstate-lookup/main.go: Added a new command-line flag s3-endpoint-url to specify a custom S3 endpoint URL. Set the corresponding environment variable if the flag is provided. [1] [2]

S3 State Reading:

  • tfstate/lookup.go: Modified the readS3 function to accept and use a custom S3 endpoint URL from the environment variable. Updated the S3Option struct to include Endpoint.
  • tfstate/remote_s3.go: Refactored the S3 option handling to include AccessKey, SecretKey, and Endpoint. Added support for static credentials and custom endpoints in the S3 client configuration. [1] [2] [3]

Testing:

@fujiwara fujiwara merged commit a0960b5 into main Feb 7, 2025
4 checks passed
@fujiwara fujiwara deleted the s3-endpoint branch February 7, 2025 17:31
@github-actions github-actions bot mentioned this pull request Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant