Skip to content

Support show terraform plan details in MR status when the managementPolicies is observe #1858

@maxsxu

Description

@maxsxu

What problem are you facing?

Assume I created a S3 Bucket successfully, then I change to observe policy to avoid any unexpected changes:

apiVersion: s3.aws.m.upbound.io/v1beta1
kind: Bucket
metadata:
  annotations:
    crossplane.io/external-name: test-bucket
  name: test-bucket
  namespace: default
spec:
  forProvider:
    region: us-east-1
    tags:
      Name: test-bucket
  managementPolicies: ["Observe"]

Now I changed some fields, I need to get the terraform plan before I change the managementPolicies to * to make the operations more safely.

What could help solve your problem?

Add a field in the status, e.g

apiVersion: s3.aws.m.upbound.io/v1beta1
kind: Bucket
metadata:
  annotations:
    crossplane.io/external-name: test-bucket
  name: test-bucket
  namespace: default
spec:
  forProvider:
    region: us-east-1
    tags:
      Name: test-bucket
+      NewTag: NewValue
  managementPolicies: ["Observe"]
status:
+  plan:
+    add:
+      tags:
+         NewTag: NewValue

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions