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 an environment import resource #858

Merged
merged 12 commits into from
May 30, 2024

Conversation

alonnoga
Copy link
Contributor

@alonnoga alonnoga commented May 23, 2024

Issue & Steps to Reproduce / Feature Request

part of #856

  1. Adding the actual resource
  2. fix api endpoint
  3. remove variables from the api types

@@ -1161,7 +1161,8 @@ func getEnvironmentById(environmentId string, meta interface{}) (client.Environm
return environment, nil
}

func resourceEnvironmentImport(ctx context.Context, d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) {
// a function to import an environment resource not to be consufed with the "environment import" resource (which is a different resource)
func resourceEnvironmentImporter(ctx context.Context, d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

its a function that handles importing environment resources ( not environment import resource )

Copy link
Contributor

Choose a reason for hiding this comment

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

yes, I just had to think twice about it that's all


// should not actually delete the environment import
func resourceEnvironmentImportDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {
return nil
Copy link
Collaborator

Choose a reason for hiding this comment

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

I am not sure this is correct. Can you please explain why you want to create a drift?
If it's really required, perhaps add an explanation to the code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We're creating a feature to make onboarding existing stacks to env0 easier
We don't expect people to use this resource directly we just generate code that uses it ( so we don't expect them to commit this code to git, and manage it )

All of what this resource does is populate a wizard in our UI
I'll add more info in the comment

@TomerHeber TomerHeber merged commit 3a475d6 into main May 30, 2024
5 checks passed
@TomerHeber TomerHeber deleted the feat-environment-import-resource-#856 branch May 30, 2024 03:38
@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 May 30, 2024
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.

None yet

3 participants