File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -169,6 +169,20 @@ type ExternalName struct {
169169// given resource. Key should be the field path of the field to be referenced.
170170type References map [string ]Reference
171171
172+ // AddReference adds a reference configuration for the given field path.
173+ // The fieldPath is the Terraform field path of the field to be referenced.
174+ //
175+ // Example: "vpc_id" or "forwarding_rule.certificate_name" in case of nested
176+ // in another object.
177+ func (r References ) AddReference (fieldPath string , ref Reference ) error {
178+ if _ , ok := r [fieldPath ]; ok {
179+ return fmt .Errorf ("reference for field %s already exists" , fieldPath )
180+ }
181+
182+ r [fieldPath ] = ref
183+ return nil
184+ }
185+
172186// Reference represents the Crossplane options used to generate
173187// reference resolvers for fields
174188type Reference struct {
You can’t perform that action at this time.
0 commit comments