Closed phillipuniverse closed 1 year ago
Hello, @phillipuniverse I tried the same configuration as yours and I didn't have this issue at all, You probably changed the var.environment
please check this, if you want to create a server for each environment you can use the for_each or copy the resource block and change the name in each one.
@MuhammeedAlaa just to make sure, I removed the var.environment
completely and I still get a dirty terraform plan
:
resource "postmark_server" "myserver" {
name = "myserver-dev"
delivery_type = "Sandbox"
}
I am on Terraform v1.3.9 if that makes a difference.
I check again and I found that this issue happens when you use the wrong token inside account_token.
The Account API Token can be found on the API Tokens page in the Account section. Account Owners and Account Admins can see Account API Tokens, while Server Admins and Server Viewers cannot.
Check after your first terraform apply
that the server is created in your postmark portal.
Check after your first terraform apply that the server is created in your postmark portal.
Yes it was created, otherwise we would have never seen the dirty terraform plan.
The Account API token is what I was already using, here's the screenshot of the section in the Postmark admin
This is weird because I used the same version of terraform and I didn't face that problem unless I put a wrong account token but it seems like you use the right token from the screen shot so let us see if anyone have the same problem.
As no one else has the same issue we will close it.
My terraform:
Where
var.environment
can be dev, demo, sandbox, or prod.This correctly created the
myserver-dev
Postmark server. But on subsequentterraform plan
I always get back a change to update thename
of the server even though it is not truly changed:I had to ignore the changes on the
name
for it to stop prompting me in the plan: