This message was deleted.
# google-cloud
s
This message was deleted.
a
If I rerun pulumi up, the error is resolved. how do I avoid the timing issue?
b
This is an eventual consistency problem on the Google cloud api. You can run a sleep inside an apply to resolve it
a
thanks @billowy-army-68599 for the hint!
I am following up on this as it may prove helpful to others. enabling the Secret Manager API:
Copy code
secret_manager_api = projects.Service(
        "secret-manager-api-service",
        project=project.project_id, 
        service="<http://secretmanager.googleapis.com|secretmanager.googleapis.com>",
        disable_dependent_services=True
)
pulumi.export('secret_manager_service_id', secret_manager_api.id)
Added a depends_on when creating the secret in GCP Secret Manager:
Copy code
# Create the secret 
ossecret = secretmanager.Secret("opensearch-secret",
    opts=pulumi.ResourceOptions(depends_on=[secret_manager_api]),
    project = project.project_id,
    replication=secretmanager.SecretReplicationArgs(
        user_managed=secretmanager.SecretReplicationUserManagedArgs(
            replicas=[
                secretmanager.SecretReplicationUserManagedReplicaArgs(
                    location="us-east1",
                ),
            ],
        ),
    ),
    secret_id="opensearch-password"
)