Skip to content

datolabs:gcp:secrets-manager:create action ignores user-managed replication and forces global location #18

Description

@jonathan-arenas-edo

We're trying to use the datolabs:gcp:secrets-manager:create scaffolder action to create secrets in Google Cloud Secret Manager within our allowed regions, as our organization policy restricts the use of the global location via the constraints/gcp.resourceLocations constraint.

We've tried passing the following inputs to the action:

yaml

replication: user-managed
locations:

  • europe-west1

However, the action still attempts to create the secret in the global location (replication: automatic), resulting in this error:

error:
FAILED_PRECONDITION: Constraint constraints/gcp.resourceLocations violated for [orgpolicy:projects/PROJECT_ID] attempting to create a secret in [global]
This suggests that the action is either:

Ignoring the replication and locations parameters.
Or, defaulting to replication: automatic internally.

We kindly request clarification on whether the user-managed replication mode is currently supported, and if not, whether there are plans to add support for custom replication regions in the near future.

Expected behavior:

When passing replication: user-managed and a valid locations array, the secret should be created in the specified region instead of defaulting to global.

Example templating:

apiVersion: scaffolder.backstage.io/v1beta3
kind: Template
metadata:
name: create-gcp-secret
title: Create GCP Secret with custom region
description: Attempts to create a secret using user-managed replication
spec:
owner: team
type: service

parameters:
- title: Secret info
required:
- name
- value
- project
- region
properties:
name:
type: string
value:
type: string
ui:widget: password
project:
type: string
enum:
- edo-test-resources
region:
type: string
enum:
- europe-west1

steps:
- id: create-secret
name: Create secret in GCP
action: datolabs:gcp:secrets-manager:create
input:
name: ${{ parameters.name }}
project: ${{ parameters.project }}
value: ${{ parameters.value }}
replication: user-managed
locations:
- ${{ parameters.region }}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions