Terraform Topic resource already exists in across projects? How to handle this?What is the correct way to add a second disk using Terraform on Google ComputeHow to configure credential file for TerraformTerraform on GCP fails to create pubsub topic stating permission deniedTerraform google 'compute.subnetworks.use' permission issuewhy do we get resource exists error in terraform?google storage transfer service account does not exist in new projectTerraform auth not working when adding resourcesPub Sub Topic not associated with Project errorGoogle Pubsub Subscription based on attributes or Message contentAssign existing SNS Topic to Alarm in Terraform
How to switch an 80286 from protected to real mode?
Can I enter a rental property without giving notice if I'm afraid a tenant may be hurt?
Do some languages mention the top limit of a range first?
Whats the difference between <processors> and <pipelines> in Sitecore configuration?
What does the ISO setting for mechanical 35mm film cameras actually do?
split large formula in align
Is the first page of a novel really that important?
Is a switch from R to Python worth it?
How do I get the =LEFT function in excel, to also take the number zero as the first number?
Is space radiation a risk for space film photography, and how is this prevented?
London underground zone 1-2 train ticket
Which genus do I use for neutral expressions in German?
Vibration on the guitar when playing two strings
What's going on with an item that starts with an hbox?
Not been paid even after reminding the Treasurer; what should I do?
Ubuntu show wrong disk sizes, how to solve it?
Plato and the knowledge of the forms
What is an air conditioner compressor hard start kit and how does it work?
What is the German idiom or expression for when someone is being hypocritical against their own teachings?
What are the function of EM and EN spaces?
Why does putting a dot after the URL remove login information?
Find only those folders that contain a File with the same name as the Folder
If someone else uploads my GPL'd code to Github without my permission, is that a copyright violation?
Where to pee in London?
Terraform Topic resource already exists in across projects? How to handle this?
What is the correct way to add a second disk using Terraform on Google ComputeHow to configure credential file for TerraformTerraform on GCP fails to create pubsub topic stating permission deniedTerraform google 'compute.subnetworks.use' permission issuewhy do we get resource exists error in terraform?google storage transfer service account does not exist in new projectTerraform auth not working when adding resourcesPub Sub Topic not associated with Project errorGoogle Pubsub Subscription based on attributes or Message contentAssign existing SNS Topic to Alarm in Terraform
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
How to deal with resources existing in multiple projects. In this case I have 2 TF projects and have a shared topic in google pubsub. Following the google provider docs I created this configuration in the subscriber project. But it gives me a resource already exists error.
resource "google_pubsub_topic" "item_edited"
project = "listing-dev"
name = "item_edited"
So this resource already exits in some other project but following the guides I created it our own project as well.
resource "google_pubsub_subscription" "item_edited"
name = "item_edited_subscription"
topic = "$google_pubsub_topic.item_edited.id"
project = "$module.offer-dev.gcp_project_id"
Error:
Error: Error applying plan:
1 error(s) occurred:
* google_pubsub_topic.item_edited: 1 error(s) occurred:
* google_pubsub_topic.item_edited: googleapi: Error 409: Resource already exists in the project (resource=item_edited)., alreadyExists
google-cloud-platform terraform google-cloud-pubsub terraform-provider-gcp
add a comment |
How to deal with resources existing in multiple projects. In this case I have 2 TF projects and have a shared topic in google pubsub. Following the google provider docs I created this configuration in the subscriber project. But it gives me a resource already exists error.
resource "google_pubsub_topic" "item_edited"
project = "listing-dev"
name = "item_edited"
So this resource already exits in some other project but following the guides I created it our own project as well.
resource "google_pubsub_subscription" "item_edited"
name = "item_edited_subscription"
topic = "$google_pubsub_topic.item_edited.id"
project = "$module.offer-dev.gcp_project_id"
Error:
Error: Error applying plan:
1 error(s) occurred:
* google_pubsub_topic.item_edited: 1 error(s) occurred:
* google_pubsub_topic.item_edited: googleapi: Error 409: Resource already exists in the project (resource=item_edited)., alreadyExists
google-cloud-platform terraform google-cloud-pubsub terraform-provider-gcp
add a comment |
How to deal with resources existing in multiple projects. In this case I have 2 TF projects and have a shared topic in google pubsub. Following the google provider docs I created this configuration in the subscriber project. But it gives me a resource already exists error.
resource "google_pubsub_topic" "item_edited"
project = "listing-dev"
name = "item_edited"
So this resource already exits in some other project but following the guides I created it our own project as well.
resource "google_pubsub_subscription" "item_edited"
name = "item_edited_subscription"
topic = "$google_pubsub_topic.item_edited.id"
project = "$module.offer-dev.gcp_project_id"
Error:
Error: Error applying plan:
1 error(s) occurred:
* google_pubsub_topic.item_edited: 1 error(s) occurred:
* google_pubsub_topic.item_edited: googleapi: Error 409: Resource already exists in the project (resource=item_edited)., alreadyExists
google-cloud-platform terraform google-cloud-pubsub terraform-provider-gcp
How to deal with resources existing in multiple projects. In this case I have 2 TF projects and have a shared topic in google pubsub. Following the google provider docs I created this configuration in the subscriber project. But it gives me a resource already exists error.
resource "google_pubsub_topic" "item_edited"
project = "listing-dev"
name = "item_edited"
So this resource already exits in some other project but following the guides I created it our own project as well.
resource "google_pubsub_subscription" "item_edited"
name = "item_edited_subscription"
topic = "$google_pubsub_topic.item_edited.id"
project = "$module.offer-dev.gcp_project_id"
Error:
Error: Error applying plan:
1 error(s) occurred:
* google_pubsub_topic.item_edited: 1 error(s) occurred:
* google_pubsub_topic.item_edited: googleapi: Error 409: Resource already exists in the project (resource=item_edited)., alreadyExists
google-cloud-platform terraform google-cloud-pubsub terraform-provider-gcp
google-cloud-platform terraform google-cloud-pubsub terraform-provider-gcp
asked Mar 27 at 3:34
JehandadKJehandadK
1,4003 gold badges21 silver badges39 bronze badges
1,4003 gold badges21 silver badges39 bronze badges
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
Topic's name should have this format:
projects/<your_project>/topics/<your_topic_name>
For more information, you could check the following link and/or try the API explorer.
Hope it helps.
add a comment |
Actually, the correct answer is we need to use variables to explicitly define dependency in terraform config.
https://learn.hashicorp.com/terraform/getting-started/dependencies.html
By studying the resource attributes used in interpolation expressions, Terraform can automatically infer when one resource depends on another
add a 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%2f55369386%2fterraform-topic-resource-already-exists-in-across-projects-how-to-handle-this%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Topic's name should have this format:
projects/<your_project>/topics/<your_topic_name>
For more information, you could check the following link and/or try the API explorer.
Hope it helps.
add a comment |
Topic's name should have this format:
projects/<your_project>/topics/<your_topic_name>
For more information, you could check the following link and/or try the API explorer.
Hope it helps.
add a comment |
Topic's name should have this format:
projects/<your_project>/topics/<your_topic_name>
For more information, you could check the following link and/or try the API explorer.
Hope it helps.
Topic's name should have this format:
projects/<your_project>/topics/<your_topic_name>
For more information, you could check the following link and/or try the API explorer.
Hope it helps.
answered Mar 27 at 15:31
F10F10
1,7172 gold badges6 silver badges15 bronze badges
1,7172 gold badges6 silver badges15 bronze badges
add a comment |
add a comment |
Actually, the correct answer is we need to use variables to explicitly define dependency in terraform config.
https://learn.hashicorp.com/terraform/getting-started/dependencies.html
By studying the resource attributes used in interpolation expressions, Terraform can automatically infer when one resource depends on another
add a comment |
Actually, the correct answer is we need to use variables to explicitly define dependency in terraform config.
https://learn.hashicorp.com/terraform/getting-started/dependencies.html
By studying the resource attributes used in interpolation expressions, Terraform can automatically infer when one resource depends on another
add a comment |
Actually, the correct answer is we need to use variables to explicitly define dependency in terraform config.
https://learn.hashicorp.com/terraform/getting-started/dependencies.html
By studying the resource attributes used in interpolation expressions, Terraform can automatically infer when one resource depends on another
Actually, the correct answer is we need to use variables to explicitly define dependency in terraform config.
https://learn.hashicorp.com/terraform/getting-started/dependencies.html
By studying the resource attributes used in interpolation expressions, Terraform can automatically infer when one resource depends on another
answered Apr 18 at 1:13
JehandadKJehandadK
1,4003 gold badges21 silver badges39 bronze badges
1,4003 gold badges21 silver badges39 bronze badges
add a comment |
add a 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%2f55369386%2fterraform-topic-resource-already-exists-in-across-projects-how-to-handle-this%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