Open LuisAyazo opened 2 years ago
hi @LuisAyazo - it would help us a lot if you could reformat your issue to include code fences and remove extraneous markdown headers 💟
Hi @guineveresaenger now it looks better. all the codes were formatted.
Did some digging into this with guineveresaenger In a nutshell:
appID
output for the app resource(s) to use the given app's name instead of the UUID stored in the state file, import the updated state and then do a pulumi destroy
it will work.FWIW, this simplified code along with the the app.py
component resource and yaml file shared above can be used to reproduce the problem as follows
pulumi up
pulumi destroy
# import pulumi
from pulumi import Config, ResourceOptions, StackReference
from apps import Apps, AppsArgs
config = Config()
general_cfg = config.require_object("general")
business_unit = general_cfg.get("business_unit")
initiative = general_cfg.get("initiative")
platform = general_cfg.get("platform")
environment = general_cfg.get("environment")
default_region = general_cfg.get("default_region")
di = general_cfg.get("di")
stack_infra = f"{business_unit}-{initiative}-{platform}-{environment}"
common_labels = {"stack": stack_infra, "environment": environment, "di": di}
apigee_cfg = config.require_object("apigee")
for app in apigee_cfg["publish"]["apps"]:
for j in range(len(app["app"])):
apps = Apps(
resource_name=f"devops-pulumi-apigee-{app['app'][j]['name']}",
args=AppsArgs(
organization_id="GCP PROJECT NAME GOES HERE",
developer_id=app["developer_id"],
name=app['app'][j]["name"],
api_products=app['app'][j]["api_products"],
),
opts=ResourceOptions(
providers=None,
),
)
What happened?
we are getting the following error when we are trying to update the app adding a new api_product to the list.
when i execute the pulumi up the first time, all the resources are created including the apps and the api_products asocciated to that app but when i try to add a new api_product i get that error, i test with the following curl and works:
I am able to create and update the app adding multiples api_product using the curl + googleapi
the other thing to see here is in what moment we can create another credential using this component? because we the googleapi we can create a new credential in the app or just update the credential adding a new api_product.
Steps to reproduce
the component code:
this is the code that call the component:
and the yaml file
Expected Behavior
I expect that i be able to update the app/credencial adding new api_products to the array list.
Actual Behavior
i get some error related to the app name but the name returned is not the name but the appid error:
App named 187afbf2-0cec-4a22-a8f2-a23e6e1cfff3 does not exist under devops@univision.net
the app name is Android and the id is 187afbf2-0cec-4a22-a8f2-a23e6e1cfff3using the googleapis when i try yo update the app putting a wrong name the error shows me the name of the app not the id.
Versions used
CLI Version Go Version go1.17.8 Go Compiler gc
Plugins NAME VERSION command 0.0.3 gcp 6.19.0 google-native 0.18.0 mongodbatlas 3.2.0 python unknown random 4.3.1
Host OS darwin Version 11.6.5 Arch x86_64
This project is written in python (/usr/local/bin/python3 v3.9.12)
Current Stack: univision/per
TYPE URN pulumi:pulumi:Stack urn:pulumi:per::devops_plm_gcp_infra_apigee::pulumi:pulumi:Stack::devops_plm_gcp_infra_apigee-per devops-plm-gcp-infra:apigeeCommand/alpha:apigeeCommand urn:pulumi:per::devops_plm_gcp_infra_apigee::devops-plm-gcp-infra:apigeeCommand/alpha:apigeeCommand::devops-pulumi-apigee-test-Apigee-Command devops-plm-gcp-infra:environment/alpha:Environment urn:pulumi:per::devops_plm_gcp_infra_apigee::devops-plm-gcp-infra:environment/alpha:Environment::devops-pulumi-apigee-env-test-Environment devops-plm-gcp-infra:envgroup/alpha:Envgroup urn:pulumi:per::devops_plm_gcp_infra_apigee::devops-plm-gcp-infra:envgroup/alpha:Envgroup::devops-pulumi-apigee-test-per-Envgroup devops-plm-gcp-infra:envgroup/alpha:Envgroup urn:pulumi:per::devops_plm_gcp_infra_apigee::devops-plm-gcp-infra:envgroup/alpha:Envgroup::devops-pulumi-apigee-test-per-2-Envgroup devops-plm-gcp-infra:apigeeCommand/alpha:apigeeCommand urn:pulumi:per::devops_plm_gcp_infra_apigee::devops-plm-gcp-infra:apigeeCommand/alpha:apigeeCommand::devops-pulumi-apigee-client-api-tokenless-Apigee-Command pulumi:providers:pulumi urn:pulumi:per::devops_plm_gcp_infra_apigee::pulumi:providers:pulumi::default pulumi:providers:command urn:pulumi:per::devops_plm_gcp_infra_apigee::pulumi:providers:command::default_0_0_3 command:local:Command urn:pulumi:per::devops_plm_gcp_infra_apigee::devops-plm-gcp-infra:apigeeCommand/alpha:apigeeCommand$command:local:Command::devops-pulumi-apigee-test pulumi:providers:google-native urn:pulumi:per::devops_plm_gcp_infra_apigee::pulumi:providers:google-native::default_0_18_0 google-native:apigee/v1:Envgroup urn:pulumi:per::devops_plm_gcp_infra_apigee::devops-plm-gcp-infra:envgroup/alpha:Envgroup$google-native:apigee/v1:Envgroup::devops-pulumi-apigee-test-per google-native:apigee/v1:Environment urn:pulumi:per::devops_plm_gcp_infra_apigee::devops-plm-gcp-infra:environment/alpha:Environment$google-native:apigee/v1:Environment::devops-pulumi-apigee-env-test google-native:apigee/v1:Envgroup urn:pulumi:per::devops_plm_gcp_infra_apigee::devops-plm-gcp-infra:envgroup/alpha:Envgroup$google-native:apigee/v1:Envgroup::devops-pulumi-apigee-test-per-2 command:local:Command urn:pulumi:per::devops_plm_gcp_infra_apigee::devops-plm-gcp-infra:apigeeCommand/alpha:apigeeCommand$command:local:Command::devops-pulumi-apigee-client-api-tokenless devops-plm-gcp-infra:apigeeTargetServer/alpha:apigeeTargetServer urn:pulumi:per::devops_plm_gcp_infra_apigee::devops-plm-gcp-infra:apigeeTargetServer/alpha:apigeeTargetServer::devops-pulumi-apigee-env-test-Target-server-env-test-Apigee-TargetServer devops-plm-gcp-infra:apigeeTargetServer/alpha:apigeeTargetServer urn:pulumi:per::devops_plm_gcp_infra_apigee::devops-plm-gcp-infra:apigeeTargetServer/alpha:apigeeTargetServer::devops-pulumi-apigee-env-test-Target-server-env-test2-Apigee-TargetServer devops-plm-gcp-infra:apigeeTargetServer/alpha:apigeeTargetServer urn:pulumi:per::devops_plm_gcp_infra_apigee::devops-plm-gcp-infra:apigeeTargetServer/alpha:apigeeTargetServer::devops-pulumi-apigee-env-test-client-api-loadbalancer-Apigee-TargetServer devops-plm-gcp-infra:apigeeTargetServer/alpha:apigeeTargetServer urn:pulumi:per::devops_plm_gcp_infra_apigee::devops-plm-gcp-infra:apigeeTargetServer/alpha:apigeeTargetServer::devops-pulumi-apigee-env-test-Target-server-env-test3-Apigee-TargetServer devops-plm-gcp-infra:apigeeApiProducts/alpha:apigeeApiProducts urn:pulumi:per::devops_plm_gcp_infra_apigee::devops-plm-gcp-infra:apigeeApiProducts/alpha:apigeeApiProducts::devops-pulumi-apigee-No_anonimus-Apigee-ApiProducts devops-plm-gcp-infra:apigeeDeveloper/alpha:apigeeDeveloper urn:pulumi:per::devops_plm_gcp_infra_apigee::devops-plm-gcp-infra:apigeeDeveloper/alpha:apigeeDeveloper::devops-pulumi-apigee-devops@univision.net-Apigee-Developer devops-plm-gcp-infra:apigeeDeveloper/alpha:apigeeDeveloper urn:pulumi:per::devops_plm_gcp_infra_apigee::devops-plm-gcp-infra:apigeeDeveloper/alpha:apigeeDeveloper::devops-pulumi-apigee-devops1@univision.net-Apigee-Developer devops-plm-gcp-infra:apigeeEnvgroupAttachment/alpha:apigeeEnvgroupAttachment urn:pulumi:per::devops_plm_gcp_infra_apigee::devops-plm-gcp-infra:apigeeEnvgroupAttachment/alpha:apigeeEnvgroupAttachment::devops-pulumi-apigee-test-per-Apigee-EnvgroupAttachment devops-plm-gcp-infra:apigeeApiProducts/alpha:apigeeApiProducts urn:pulumi:per::devops_plm_gcp_infra_apigee::devops-plm-gcp-infra:apigeeApiProducts/alpha:apigeeApiProducts::devops-pulumi-apigee-Tokenless_Client_API-Apigee-ApiProducts devops-plm-gcp-infra:apigeeApiProducts/alpha:apigeeApiProducts urn:pulumi:per::devops_plm_gcp_infra_apigee::devops-plm-gcp-infra:apigeeApiProducts/alpha:apigeeApiProducts::devops-pulumi-apigee-Client_API_Tokenized_for_Server_Apps-Apigee-ApiProducts google-native:apigee/v1:TargetServer urn:pulumi:per::devops_plm_gcp_infra_apigee::devops-plm-gcp-infra:apigeeTargetServer/alpha:apigeeTargetServer$google-native:apigee/v1:TargetServer::devops-pulumi-apigee-env-test-Target-server-env-test2 google-native:apigee/v1:TargetServer urn:pulumi:per::devops_plm_gcp_infra_apigee::devops-plm-gcp-infra:apigeeTargetServer/alpha:apigeeTargetServer$google-native:apigee/v1:TargetServer::devops-pulumi-apigee-env-test-client-api-loadbalancer google-native:apigee/v1:TargetServer urn:pulumi:per::devops_plm_gcp_infra_apigee::devops-plm-gcp-infra:apigeeTargetServer/alpha:apigeeTargetServer$google-native:apigee/v1:TargetServer::devops-pulumi-apigee-env-test-Target-server-env-test google-native:apigee/v1:ApiProduct urn:pulumi:per::devops_plm_gcp_infra_apigee::devops-plm-gcp-infra:apigeeApiProducts/alpha:apigeeApiProducts$google-native:apigee/v1:ApiProduct::devops-pulumi-apigee-No_anonimus google-native:apigee/v1:Developer urn:pulumi:per::devops_plm_gcp_infra_apigee::devops-plm-gcp-infra:apigeeDeveloper/alpha:apigeeDeveloper$google-native:apigee/v1:Developer::devops-pulumi-apigee-devops1@univision.net google-native:apigee/v1:TargetServer urn:pulumi:per::devops_plm_gcp_infra_apigee::devops-plm-gcp-infra:apigeeTargetServer/alpha:apigeeTargetServer$google-native:apigee/v1:TargetServer::devops-pulumi-apigee-env-test-Target-server-env-test3 google-native:apigee/v1:EnvgroupAttachment urn:pulumi:per::devops_plm_gcp_infra_apigee::devops-plm-gcp-infra:apigeeEnvgroupAttachment/alpha:apigeeEnvgroupAttachment$google-native:apigee/v1:EnvgroupAttachment::devops-pulumi-apigee-test-per google-native:apigee/v1:ApiProduct urn:pulumi:per::devops_plm_gcp_infra_apigee::devops-plm-gcp-infra:apigeeApiProducts/alpha:apigeeApiProducts$google-native:apigee/v1:ApiProduct::devops-pulumi-apigee-Client_API_Tokenized_for_Server_Apps google-native:apigee/v1:ApiProduct urn:pulumi:per::devops_plm_gcp_infra_apigee::devops-plm-gcp-infra:apigeeApiProducts/alpha:apigeeApiProducts$google-native:apigee/v1:ApiProduct::devops-pulumi-apigee-Tokenless_Client_API google-native:apigee/v1:Developer urn:pulumi:per::devops_plm_gcp_infra_apigee::devops-plm-gcp-infra:apigeeDeveloper/alpha:apigeeDeveloper$google-native:apigee/v1:Developer::devops-pulumi-apigee-devops@univision.net devops-plm-gcp-infra:apigeeApiProxy/alpha:apigeeApps urn:pulumi:per::devops_plm_gcp_infra_apigee::devops-plm-gcp-infra:apigeeApiProxy/alpha:apigeeApps::devops-pulumi-apigee-Android-Apigee-Apps devops-plm-gcp-infra:apigeeApiProxy/alpha:apigeeApps urn:pulumi:per::devops_plm_gcp_infra_apigee::devops-plm-gcp-infra:apigeeApiProxy/alpha:apigeeApps::devops-pulumi-apigee-Apple-Apigee-Apps google-native:apigee/v1:App urn:pulumi:per::devops_plm_gcp_infra_apigee::devops-plm-gcp-infra:apigeeApiProxy/alpha:apigeeApps$google-native:apigee/v1:App::devops-pulumi-apigee-Android pulumi:pulumi:StackReference urn:pulumi:per::devops_plm_gcp_infra_apigee::pulumi:pulumi:StackReference::univision/devops_plm_gcp_infra_apigee/per google-native:apigee/v1:App urn:pulumi:per::devops_plm_gcp_infra_apigee::devops-plm-gcp-infra:apigeeApiProxy/alpha:apigeeApps$google-native:apigee/v1:App::devops-pulumi-apigee-Apple
Found no pending operations associated with univision/per
Backend Name pulumi.com URL https://app.pulumi.com/pichipaul User pichipaul
NAME VERSION aiodns 3.0.0 asyncio 3.4.3 autopep8 1.5.7 bcrypt 3.2.0 black 21.8b0 boto3 1.18.55 Cerberus 1.3.4 ddtrace 0.51.1 devops-plm-gcp-infra 1.28.0 email-validator 1.1.3 fastapi 0.67.0 google-api-python-client 2.19.1 google-auth-oauthlib 0.4.6 ipython 7.26.0 jaeger-client 4.6.0 lockfile 0.12.2 locust 2.1.0 mailjet-rest 1.3.4 motor 2.5.0 opentracing-instrumentation 3.3.1 passlib 1.7.4 pip 22.0.4 poetry 1.1.11 pre-commit 2.15.0 pulumi-command 0.0.3 PyJWT 2.1.0 pytest-cov 3.0.0 python-decouple 3.4 python-multipart 0.0.5 slackclient 2.9.3 UnleashClient 4.4.1 uvicorn 0.14.0 wheel 0.37.1
Pulumi locates its logs in /var/folders/0z/z7p0n8197g3fbytpzry587lr0000gp/T/ by default warning: A new version of Pulumi is available. To upgrade from version '0.0.0' to '3.29.1', run $ brew upgrade pulumi or visit https://pulumi.com/docs/reference/install/ for manual instructions and release notes.
Additional context
i thing inside the code is necessary to fix the name of the app but beside it should be a way to tell the component (app) if we want to create a new credential or update an existent app adding more products.
Contributing
Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).