Terraform: How to Upgrade Provider without Changing Terraform VersionIs it possible to link a terraform workspace to an AWS accountTerraform: how to support different providers“value of count cannot be computed” when it depends on an AWS SSM parameter data sourceTerraform Planning to delete resources when planning changesterraform.tfstate not working with workspaceTerraform apply after Terraform import wants to force new resource for storage gateway cacheTerraform Upgrade ProvidersTerraform resource recreation dynamic AWS RDS instance countsTerraform AWS Provider V2?Create aws_launch_templates from Terraform
Pre-Employment Background Check With Consent For Future Checks
Do I have to take mana from my deck or hand when tapping a dual land?
Can I run 125kHz RF circuit on a breadboard?
What should be the ideal length of sentences in a blog post for ease of reading?
Would this string work as string?
Why is participating in the European Parliamentary elections used as a threat?
How to make money from a browser who sees 5 seconds into the future of any web page?
How to preserve electronics (computers, iPads and phones) for hundreds of years
Does Doodling or Improvising on the Piano Have Any Benefits?
I'm just a whisper. Who am I?
Why can't the Brexit deadlock in the UK parliament be solved with a plurality vote?
The Digit Triangles
Should I warn new/prospective PhD Student that supervisor is terrible?
What is this high flying aircraft over Pennsylvania?
How to leave product feedback on macOS?
El Dorado Word Puzzle II: Videogame Edition
Isometric embedding of a genus g surface
Is there anyway, I can have two passwords for my wi-fi
Has the laser at Magurele, Romania reached a tenth of the Sun's power?
Make a Bowl of Alphabet Soup
Personal or impersonal in a technical resume
What does "tick" mean in this sentence?
What is the meaning of the following sentence?
Given this phrasing in the lease, when should I pay my rent?
Terraform: How to Upgrade Provider without Changing Terraform Version
Is it possible to link a terraform workspace to an AWS accountTerraform: how to support different providers“value of count cannot be computed” when it depends on an AWS SSM parameter data sourceTerraform Planning to delete resources when planning changesterraform.tfstate not working with workspaceTerraform apply after Terraform import wants to force new resource for storage gateway cacheTerraform Upgrade ProvidersTerraform resource recreation dynamic AWS RDS instance countsTerraform AWS Provider V2?Create aws_launch_templates from Terraform
when I try to run terraform apply, I see Error:
aws_glue_catalog_database.test: Provider doesn't support resource: aws_glue_catalog_database
Looks like my provider is old because terraform version shows provider.aws v1.6.0 and in fact I can launch glue in another folder with the same terraform version but with a newer provider.aws v2.0.0
Terraform v0.11.10
+ provider.archive v1.0.0
+ provider.aws v1.6.0
+ provider.null v1.0.0
+ provider.template v1.0.0
I tried to upgrade provider but keep the terraform version v0.11.10 the same. to do that, I run terraform init -upgrade but see the below warning:
terraform init -upgrade
Initializing the backend...
Backend configuration changed!
Terraform has detected that the configuration specified for the backend
has changed. Terraform will now check for existing state in the backends.
Do you want to migrate all workspaces to "s3"?
Both the existing "s3" backend and the newly configured "s3" backend
support workspaces. When migrating between backends, Terraform will copy
all workspaces (with the same names). THIS WILL OVERWRITE any conflicting
states in the destination.
Terraform initialization doesn't currently migrate only select workspaces.
If you want to migrate a select number of workspaces, you must manually
pull and push those states.
If you answer "yes", Terraform will migrate all states. If you answer
"no", Terraform will abort.
I decided to say "no" because the above warning scared me.
I do have a backend "s3" resource to remote store the status in s3 and have several workspaces. I do not understand why and how the backend and workspace will be changed if I upgrade provider using above command; whether it will break my system.
Does anybody know whether it is ok for me to say yes without messing things? or which terraform cmd I should run to upgrade provider without change terraform version? Thanks.
terraform-provider-aws
add a comment |
when I try to run terraform apply, I see Error:
aws_glue_catalog_database.test: Provider doesn't support resource: aws_glue_catalog_database
Looks like my provider is old because terraform version shows provider.aws v1.6.0 and in fact I can launch glue in another folder with the same terraform version but with a newer provider.aws v2.0.0
Terraform v0.11.10
+ provider.archive v1.0.0
+ provider.aws v1.6.0
+ provider.null v1.0.0
+ provider.template v1.0.0
I tried to upgrade provider but keep the terraform version v0.11.10 the same. to do that, I run terraform init -upgrade but see the below warning:
terraform init -upgrade
Initializing the backend...
Backend configuration changed!
Terraform has detected that the configuration specified for the backend
has changed. Terraform will now check for existing state in the backends.
Do you want to migrate all workspaces to "s3"?
Both the existing "s3" backend and the newly configured "s3" backend
support workspaces. When migrating between backends, Terraform will copy
all workspaces (with the same names). THIS WILL OVERWRITE any conflicting
states in the destination.
Terraform initialization doesn't currently migrate only select workspaces.
If you want to migrate a select number of workspaces, you must manually
pull and push those states.
If you answer "yes", Terraform will migrate all states. If you answer
"no", Terraform will abort.
I decided to say "no" because the above warning scared me.
I do have a backend "s3" resource to remote store the status in s3 and have several workspaces. I do not understand why and how the backend and workspace will be changed if I upgrade provider using above command; whether it will break my system.
Does anybody know whether it is ok for me to say yes without messing things? or which terraform cmd I should run to upgrade provider without change terraform version? Thanks.
terraform-provider-aws
add a comment |
when I try to run terraform apply, I see Error:
aws_glue_catalog_database.test: Provider doesn't support resource: aws_glue_catalog_database
Looks like my provider is old because terraform version shows provider.aws v1.6.0 and in fact I can launch glue in another folder with the same terraform version but with a newer provider.aws v2.0.0
Terraform v0.11.10
+ provider.archive v1.0.0
+ provider.aws v1.6.0
+ provider.null v1.0.0
+ provider.template v1.0.0
I tried to upgrade provider but keep the terraform version v0.11.10 the same. to do that, I run terraform init -upgrade but see the below warning:
terraform init -upgrade
Initializing the backend...
Backend configuration changed!
Terraform has detected that the configuration specified for the backend
has changed. Terraform will now check for existing state in the backends.
Do you want to migrate all workspaces to "s3"?
Both the existing "s3" backend and the newly configured "s3" backend
support workspaces. When migrating between backends, Terraform will copy
all workspaces (with the same names). THIS WILL OVERWRITE any conflicting
states in the destination.
Terraform initialization doesn't currently migrate only select workspaces.
If you want to migrate a select number of workspaces, you must manually
pull and push those states.
If you answer "yes", Terraform will migrate all states. If you answer
"no", Terraform will abort.
I decided to say "no" because the above warning scared me.
I do have a backend "s3" resource to remote store the status in s3 and have several workspaces. I do not understand why and how the backend and workspace will be changed if I upgrade provider using above command; whether it will break my system.
Does anybody know whether it is ok for me to say yes without messing things? or which terraform cmd I should run to upgrade provider without change terraform version? Thanks.
terraform-provider-aws
when I try to run terraform apply, I see Error:
aws_glue_catalog_database.test: Provider doesn't support resource: aws_glue_catalog_database
Looks like my provider is old because terraform version shows provider.aws v1.6.0 and in fact I can launch glue in another folder with the same terraform version but with a newer provider.aws v2.0.0
Terraform v0.11.10
+ provider.archive v1.0.0
+ provider.aws v1.6.0
+ provider.null v1.0.0
+ provider.template v1.0.0
I tried to upgrade provider but keep the terraform version v0.11.10 the same. to do that, I run terraform init -upgrade but see the below warning:
terraform init -upgrade
Initializing the backend...
Backend configuration changed!
Terraform has detected that the configuration specified for the backend
has changed. Terraform will now check for existing state in the backends.
Do you want to migrate all workspaces to "s3"?
Both the existing "s3" backend and the newly configured "s3" backend
support workspaces. When migrating between backends, Terraform will copy
all workspaces (with the same names). THIS WILL OVERWRITE any conflicting
states in the destination.
Terraform initialization doesn't currently migrate only select workspaces.
If you want to migrate a select number of workspaces, you must manually
pull and push those states.
If you answer "yes", Terraform will migrate all states. If you answer
"no", Terraform will abort.
I decided to say "no" because the above warning scared me.
I do have a backend "s3" resource to remote store the status in s3 and have several workspaces. I do not understand why and how the backend and workspace will be changed if I upgrade provider using above command; whether it will break my system.
Does anybody know whether it is ok for me to say yes without messing things? or which terraform cmd I should run to upgrade provider without change terraform version? Thanks.
terraform-provider-aws
terraform-provider-aws
asked Mar 7 at 22:04
user389955user389955
2,32232339
2,32232339
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
You're doing a major release upgrade so there is always risk I'm afraid.
Here are some links that could help you to highlight risks (if you haven't seen them already):
https://www.terraform.io/docs/providers/aws/guides/version-2-upgrade.html#provider-version-configuration- https://github.com/terraform-providers/terraform-provider-aws/blob/master/CHANGELOG.md
Before doing anything, I would recommend backing up the state files that are stored on the remote S3 bucket first. If your infrastructure is fairly static (or you have a mechanism to make it static), you could always put the old backups of the state back into S3 if it goes horribly wrong without causing an issue as no applies would have occurred during your upgrade process.
I don't know your setup but ideally you would be doing this in a development environment first which should hopefully ease your nerves about changing state files.
Thanks I will try to backup remote state files. what do you mean "If your infrastructure is fairly static" what is static?
– user389955
Mar 11 at 23:27
Yeah sorry, that wasn't very clear. If you are the only person who will be running a terraform plan/apply and there is no automated process to regularly run those commands - then that is what I would describe as 'static'. In contrast, I have worked in places where every 30mins-1hr terraform is run automatically against the infrastructure to ensure everything is as expected. In these such scenarios, changing state files can be pretty dangerous due to conflicts. (We had a mechanism to temporarily stop that automated running of terraform to minimise the risk of changing state files.)
– hhami
Mar 12 at 14:32
hhami: Oh, Thanks, I know what you mean now.
– user389955
Mar 13 at 17:13
hhami: last question: so terraform init -upgrade will only upgrade provider but will not change Terraform version is it correct? I do not want to change Terraform version. Usually I change version only if others change and I have to change. and the way I change Terraform version is to download a new version. so I guess terraform init -upgrade should only upgrade provider, not version. Thanks
– user389955
Mar 13 at 17:18
Yes, I'm 99% sure that is correct. It will upgrade the provider/plugins, not the terraform version itself. For terraform version, I too download the bin files and point a symlink to which version I want to use :).
– hhami
Mar 14 at 14:23
|
show 1 more comment
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55053536%2fterraform-how-to-upgrade-provider-without-changing-terraform-version%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You're doing a major release upgrade so there is always risk I'm afraid.
Here are some links that could help you to highlight risks (if you haven't seen them already):
https://www.terraform.io/docs/providers/aws/guides/version-2-upgrade.html#provider-version-configuration- https://github.com/terraform-providers/terraform-provider-aws/blob/master/CHANGELOG.md
Before doing anything, I would recommend backing up the state files that are stored on the remote S3 bucket first. If your infrastructure is fairly static (or you have a mechanism to make it static), you could always put the old backups of the state back into S3 if it goes horribly wrong without causing an issue as no applies would have occurred during your upgrade process.
I don't know your setup but ideally you would be doing this in a development environment first which should hopefully ease your nerves about changing state files.
Thanks I will try to backup remote state files. what do you mean "If your infrastructure is fairly static" what is static?
– user389955
Mar 11 at 23:27
Yeah sorry, that wasn't very clear. If you are the only person who will be running a terraform plan/apply and there is no automated process to regularly run those commands - then that is what I would describe as 'static'. In contrast, I have worked in places where every 30mins-1hr terraform is run automatically against the infrastructure to ensure everything is as expected. In these such scenarios, changing state files can be pretty dangerous due to conflicts. (We had a mechanism to temporarily stop that automated running of terraform to minimise the risk of changing state files.)
– hhami
Mar 12 at 14:32
hhami: Oh, Thanks, I know what you mean now.
– user389955
Mar 13 at 17:13
hhami: last question: so terraform init -upgrade will only upgrade provider but will not change Terraform version is it correct? I do not want to change Terraform version. Usually I change version only if others change and I have to change. and the way I change Terraform version is to download a new version. so I guess terraform init -upgrade should only upgrade provider, not version. Thanks
– user389955
Mar 13 at 17:18
Yes, I'm 99% sure that is correct. It will upgrade the provider/plugins, not the terraform version itself. For terraform version, I too download the bin files and point a symlink to which version I want to use :).
– hhami
Mar 14 at 14:23
|
show 1 more comment
You're doing a major release upgrade so there is always risk I'm afraid.
Here are some links that could help you to highlight risks (if you haven't seen them already):
https://www.terraform.io/docs/providers/aws/guides/version-2-upgrade.html#provider-version-configuration- https://github.com/terraform-providers/terraform-provider-aws/blob/master/CHANGELOG.md
Before doing anything, I would recommend backing up the state files that are stored on the remote S3 bucket first. If your infrastructure is fairly static (or you have a mechanism to make it static), you could always put the old backups of the state back into S3 if it goes horribly wrong without causing an issue as no applies would have occurred during your upgrade process.
I don't know your setup but ideally you would be doing this in a development environment first which should hopefully ease your nerves about changing state files.
Thanks I will try to backup remote state files. what do you mean "If your infrastructure is fairly static" what is static?
– user389955
Mar 11 at 23:27
Yeah sorry, that wasn't very clear. If you are the only person who will be running a terraform plan/apply and there is no automated process to regularly run those commands - then that is what I would describe as 'static'. In contrast, I have worked in places where every 30mins-1hr terraform is run automatically against the infrastructure to ensure everything is as expected. In these such scenarios, changing state files can be pretty dangerous due to conflicts. (We had a mechanism to temporarily stop that automated running of terraform to minimise the risk of changing state files.)
– hhami
Mar 12 at 14:32
hhami: Oh, Thanks, I know what you mean now.
– user389955
Mar 13 at 17:13
hhami: last question: so terraform init -upgrade will only upgrade provider but will not change Terraform version is it correct? I do not want to change Terraform version. Usually I change version only if others change and I have to change. and the way I change Terraform version is to download a new version. so I guess terraform init -upgrade should only upgrade provider, not version. Thanks
– user389955
Mar 13 at 17:18
Yes, I'm 99% sure that is correct. It will upgrade the provider/plugins, not the terraform version itself. For terraform version, I too download the bin files and point a symlink to which version I want to use :).
– hhami
Mar 14 at 14:23
|
show 1 more comment
You're doing a major release upgrade so there is always risk I'm afraid.
Here are some links that could help you to highlight risks (if you haven't seen them already):
https://www.terraform.io/docs/providers/aws/guides/version-2-upgrade.html#provider-version-configuration- https://github.com/terraform-providers/terraform-provider-aws/blob/master/CHANGELOG.md
Before doing anything, I would recommend backing up the state files that are stored on the remote S3 bucket first. If your infrastructure is fairly static (or you have a mechanism to make it static), you could always put the old backups of the state back into S3 if it goes horribly wrong without causing an issue as no applies would have occurred during your upgrade process.
I don't know your setup but ideally you would be doing this in a development environment first which should hopefully ease your nerves about changing state files.
You're doing a major release upgrade so there is always risk I'm afraid.
Here are some links that could help you to highlight risks (if you haven't seen them already):
https://www.terraform.io/docs/providers/aws/guides/version-2-upgrade.html#provider-version-configuration- https://github.com/terraform-providers/terraform-provider-aws/blob/master/CHANGELOG.md
Before doing anything, I would recommend backing up the state files that are stored on the remote S3 bucket first. If your infrastructure is fairly static (or you have a mechanism to make it static), you could always put the old backups of the state back into S3 if it goes horribly wrong without causing an issue as no applies would have occurred during your upgrade process.
I don't know your setup but ideally you would be doing this in a development environment first which should hopefully ease your nerves about changing state files.
answered Mar 8 at 16:31
hhamihhami
112
112
Thanks I will try to backup remote state files. what do you mean "If your infrastructure is fairly static" what is static?
– user389955
Mar 11 at 23:27
Yeah sorry, that wasn't very clear. If you are the only person who will be running a terraform plan/apply and there is no automated process to regularly run those commands - then that is what I would describe as 'static'. In contrast, I have worked in places where every 30mins-1hr terraform is run automatically against the infrastructure to ensure everything is as expected. In these such scenarios, changing state files can be pretty dangerous due to conflicts. (We had a mechanism to temporarily stop that automated running of terraform to minimise the risk of changing state files.)
– hhami
Mar 12 at 14:32
hhami: Oh, Thanks, I know what you mean now.
– user389955
Mar 13 at 17:13
hhami: last question: so terraform init -upgrade will only upgrade provider but will not change Terraform version is it correct? I do not want to change Terraform version. Usually I change version only if others change and I have to change. and the way I change Terraform version is to download a new version. so I guess terraform init -upgrade should only upgrade provider, not version. Thanks
– user389955
Mar 13 at 17:18
Yes, I'm 99% sure that is correct. It will upgrade the provider/plugins, not the terraform version itself. For terraform version, I too download the bin files and point a symlink to which version I want to use :).
– hhami
Mar 14 at 14:23
|
show 1 more comment
Thanks I will try to backup remote state files. what do you mean "If your infrastructure is fairly static" what is static?
– user389955
Mar 11 at 23:27
Yeah sorry, that wasn't very clear. If you are the only person who will be running a terraform plan/apply and there is no automated process to regularly run those commands - then that is what I would describe as 'static'. In contrast, I have worked in places where every 30mins-1hr terraform is run automatically against the infrastructure to ensure everything is as expected. In these such scenarios, changing state files can be pretty dangerous due to conflicts. (We had a mechanism to temporarily stop that automated running of terraform to minimise the risk of changing state files.)
– hhami
Mar 12 at 14:32
hhami: Oh, Thanks, I know what you mean now.
– user389955
Mar 13 at 17:13
hhami: last question: so terraform init -upgrade will only upgrade provider but will not change Terraform version is it correct? I do not want to change Terraform version. Usually I change version only if others change and I have to change. and the way I change Terraform version is to download a new version. so I guess terraform init -upgrade should only upgrade provider, not version. Thanks
– user389955
Mar 13 at 17:18
Yes, I'm 99% sure that is correct. It will upgrade the provider/plugins, not the terraform version itself. For terraform version, I too download the bin files and point a symlink to which version I want to use :).
– hhami
Mar 14 at 14:23
Thanks I will try to backup remote state files. what do you mean "If your infrastructure is fairly static" what is static?
– user389955
Mar 11 at 23:27
Thanks I will try to backup remote state files. what do you mean "If your infrastructure is fairly static" what is static?
– user389955
Mar 11 at 23:27
Yeah sorry, that wasn't very clear. If you are the only person who will be running a terraform plan/apply and there is no automated process to regularly run those commands - then that is what I would describe as 'static'. In contrast, I have worked in places where every 30mins-1hr terraform is run automatically against the infrastructure to ensure everything is as expected. In these such scenarios, changing state files can be pretty dangerous due to conflicts. (We had a mechanism to temporarily stop that automated running of terraform to minimise the risk of changing state files.)
– hhami
Mar 12 at 14:32
Yeah sorry, that wasn't very clear. If you are the only person who will be running a terraform plan/apply and there is no automated process to regularly run those commands - then that is what I would describe as 'static'. In contrast, I have worked in places where every 30mins-1hr terraform is run automatically against the infrastructure to ensure everything is as expected. In these such scenarios, changing state files can be pretty dangerous due to conflicts. (We had a mechanism to temporarily stop that automated running of terraform to minimise the risk of changing state files.)
– hhami
Mar 12 at 14:32
hhami: Oh, Thanks, I know what you mean now.
– user389955
Mar 13 at 17:13
hhami: Oh, Thanks, I know what you mean now.
– user389955
Mar 13 at 17:13
hhami: last question: so terraform init -upgrade will only upgrade provider but will not change Terraform version is it correct? I do not want to change Terraform version. Usually I change version only if others change and I have to change. and the way I change Terraform version is to download a new version. so I guess terraform init -upgrade should only upgrade provider, not version. Thanks
– user389955
Mar 13 at 17:18
hhami: last question: so terraform init -upgrade will only upgrade provider but will not change Terraform version is it correct? I do not want to change Terraform version. Usually I change version only if others change and I have to change. and the way I change Terraform version is to download a new version. so I guess terraform init -upgrade should only upgrade provider, not version. Thanks
– user389955
Mar 13 at 17:18
Yes, I'm 99% sure that is correct. It will upgrade the provider/plugins, not the terraform version itself. For terraform version, I too download the bin files and point a symlink to which version I want to use :).
– hhami
Mar 14 at 14:23
Yes, I'm 99% sure that is correct. It will upgrade the provider/plugins, not the terraform version itself. For terraform version, I too download the bin files and point a symlink to which version I want to use :).
– hhami
Mar 14 at 14:23
|
show 1 more comment
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55053536%2fterraform-how-to-upgrade-provider-without-changing-terraform-version%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown