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 new OIDC credentials creation and assigment (AWS Resource) #755

Merged
merged 2 commits into from
Nov 28, 2023

Conversation

TomerHeber
Copy link
Collaborator

Solution

Part of #743.

  1. Added a new AWS OIDC credentials resource.
  2. Added unit tests.
  3. Added acceptance tests.
  4. Added integration tests.
  5. Added examples.

@@ -100,6 +100,7 @@ func Provider(version string) plugin.ProviderFunc {
"env0_template": resourceTemplate(),
"env0_ssh_key": resourceSshKey(),
"env0_aws_credentials": resourceAwsCredentials(),
"env0_aws_oidc_credentials": resourceAwsOidcCredentials(),
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed. A new resource is created (same for GCP and Azure).

@TomerHeber TomerHeber requested a review from yaronya November 27, 2023 18:32
Copy link
Contributor

@Yossi-kerner Yossi-kerner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM left some minor comments

@@ -0,0 +1,2 @@
terraform import env0_aws_oidc_credentials.by_id d31a6b30-5f69-4d24-937c-22322754934e
terraform import env0_aws_oidc_credentials.by_name "credentials name"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look like you are missing an empty line here

client/cloud_credentials.go Show resolved Hide resolved
}

func resourceAwsOidcCredentialsUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {
apiClient := meta.(client.ApiClientInterface)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you extract the part before you put value in request into a function? I see it's the same code in resourceAwsOidcCredentialsUpdate and in resourceAwsOidcCredentialsCreate

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure

env0/resource_aws_oidc_credentials_test.go Show resolved Hide resolved
@TomerHeber
Copy link
Collaborator Author

LGTM left some minor comments

fixed.

@github-actions github-actions bot added ready to merge PR approved - can be merged once the PR owner is ready and removed pending final review labels Nov 28, 2023
@TomerHeber TomerHeber merged commit 16d52c2 into main Nov 28, 2023
4 checks passed
@TomerHeber TomerHeber deleted the feat-oidc-cred-resource-#743 branch November 28, 2023 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants