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

Plan step is not checking enough that apply will run successfully #245

Closed
sdenel opened this issue Jul 11, 2021 · 3 comments
Closed

Plan step is not checking enough that apply will run successfully #245

sdenel opened this issue Jul 11, 2021 · 3 comments

Comments

@sdenel
Copy link

sdenel commented Jul 11, 2021

Hi there,

Expected Behavior

terraform plan should ensure, as much as technically possible, that apply will perform successfully. Meaning that when plan is ok, apply should be ok. This is clearly not the case today.

Actual Behavior

plan step is not helping enough. Thus, when using terraform enterprise, one has to merge his feature branch to master to troubleshoot. A few examples of things that went wrong during apply, that were not detected during plan when creating an akamai_property:

  • Static validations:
    • Invalid property name
    • one of product,product_id must be specified
    • invalid client access token / secret / ... because of a trailing \n: should have been caught earlier than during the API call, where the message is not helping (Invalid header...)
  • Checks against Akamai:
    • Property name already in use
    • product_access_denied
    • Product not found
@piotrpio
Copy link
Contributor

Hello @sdenel

Thanks for submitting the issue. I have a couple of questions and comments.
First. of all, I agree with the part about static validations, that is absolutely something that can be improved and we will work on applying your suggestions for the next release. Validating edgerc credentials format can be added, as well as checking whether either product or product_id is specified during planning phase. Can you however clarify what do you mean by checking whether property name is valid? I'm not sure what kind of validation can we add there, as none are specified by the open API documentation.

As to checking against Akamai - unfortunately, if state is not available, terraform does not invoke any methods from terraform provider when preparing the plan - all it does is compare your config with resource's schema (that's where static validation takes place), but we are not able to interact with the API at that point. That is how other terraform provider work as well, e.g. AWS.

Let me know if you have any further questions.

@sdenel
Copy link
Author

sdenel commented Jul 23, 2021

Hello @piotrpio,
Thank you for your reply.

property name: I got the message "A name must only contain letters, numbers, and these characters: . _ -"

Best regards,
Simon

@lkowalsk-akamai-com
Copy link
Contributor

Hi @sdenel
Additional checks and validations has been added to the plan. You can check it out by updating to the v1.7.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants