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(tfe_saml_settings): add resource #970

Merged
merged 19 commits into from
Jul 20, 2023
Merged

feat(tfe_saml_settings): add resource #970

merged 19 commits into from
Jul 20, 2023

Conversation

karvounis-form3
Copy link
Contributor

@karvounis-form3 karvounis-form3 commented Jul 19, 2023

Description

This PR adds the resource tfe_saml_settings. This change is required in order to add SAML settings support to the provider (documentation).

Closes: #819

Testing plan

  1. The minimal configuration is as below:
provider "tfe" {}

resource "tfe_saml_settings" "this" {
  idp_cert                      = "idp_certTerraformExample"
  slo_endpoint_url              = "https://example.com/slo_endpoint_url"
  sso_endpoint_url              = "https://example.com/sso_endpoint_url"
}
  1. Run terraform apply - resources will be created successfully.
  2. Update the resource to the following:
provider "tfe" {}

resource "tfe_saml_settings" "this" {
  idp_cert                      = "idp_certTerraformExample"
  slo_endpoint_url              = "https://example-updated.com/slo_endpoint_url"
  sso_endpoint_url              = "https://example-updated.com/sso_endpoint_url"
  sso_api_token_session_timeout = "1444444"
  certificate                   = "exampleCert"
  private_key                   = "examplePrivateKey"
  signature_digest_method       = "SHA1"
  attr_username                 = "FooUsername"
  authn_requests_signed         = true
}
  1. Run terraform apply again. It will update the attributes already created (idp_cert, slo_endpoint_url, sso_endpoint_url) and set the values for the new attributes defined (sso_api_token_session_timeout, certificate, private_key, signature_digest_method, attr_username, authn_requests_signed,).
  2. Run terraform destroy. It will remove the resource from the state, disable the SAML single sign-on and set all the values to the default ones.

External links

Output from acceptance tests

$ TESTARGS="-run TestAccTFESAMLSettings" make testacc

TF_ACC=1 TF_LOG_SDK_PROTO=OFF go test $(go list ./... |grep -v 'vendor') -v -run TestAccTFESAMLSettings -timeout 15m
?   	github.com/hashicorp/terraform-provider-tfe	[no test files]
=== RUN   TestAccTFESAMLSettingsDataSource_basic
--- PASS: TestAccTFESAMLSettingsDataSource_basic (15.51s)
=== RUN   TestAccTFESAMLSettings_basic
--- PASS: TestAccTFESAMLSettings_basic (17.52s)
=== RUN   TestAccTFESAMLSettings_full
--- PASS: TestAccTFESAMLSettings_full (17.40s)
=== RUN   TestAccTFESAMLSettings_update
--- PASS: TestAccTFESAMLSettings_update (29.98s)
=== RUN   TestAccTFESAMLSettings_import
--- PASS: TestAccTFESAMLSettings_import (20.63s)
PASS
ok  	github.com/hashicorp/terraform-provider-tfe/tfe	102.966s
?   	github.com/hashicorp/terraform-provider-tfe/version	[no test files]

@karvounis-form3 karvounis-form3 marked this pull request as ready for review July 19, 2023 12:07
@karvounis-form3 karvounis-form3 requested a review from a team as a code owner July 19, 2023 12:07
@uturunku1
Copy link
Collaborator

testing on : #971

@karvounis-form3
Copy link
Contributor Author

@uturunku1 can you please trigger the tests again?

Copy link
Collaborator

@uturunku1 uturunku1 left a comment

Choose a reason for hiding this comment

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

Thanks for following through on this!
There is one test failure to address:
Screenshot 2023-07-19 at 9 27 39 AM
I have used the documentation that you linked in the PR to compare and contrast with the settings that are adding here, and so far your implementation looks accurate!
Now with all your changes put together, I'd like to a smoke test the whole workflow for this feature. Would you mind adding a Testing Plan section in the PR description that includes instructions (a tf config sample, etc) on how to smoke test for this new feature? 🙏

@karvounis-form3
Copy link
Contributor Author

@uturunku1 Thanks for reviewing the PR! I updated the ticket description with a test plan. Does that work for you? Let me know if I need to add anything else.

Copy link
Collaborator

@uturunku1 uturunku1 left a comment

Choose a reason for hiding this comment

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

Screenshot 2023-07-20 at 9 38 20 AM Works as expected! 🎉 I also verify the changes were reflected in the platform's UI. Thank you @karvounis-form3 for making quick adjustments to the test failures, and all your effort in general! 🏆

@uturunku1 uturunku1 merged commit 1d5c035 into hashicorp:main Jul 20, 2023
10 of 16 checks passed
@karvounis-form3 karvounis-form3 deleted the add-saml-settings-resource branch July 21, 2023 15:12
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.

Support SAML settings
2 participants