-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Add support IAM policy for the Environment of Apigee X * Add support IAM policy for the Environment of Apigee X * Add support IAM policy for the Environment of Apigee X * Add support IAM policy for the Environment of Apigee X * Revert all changes to test files. * Revert all changes to test files. * Revert all changes to test files. * Add primary_resource_name to fix tests. * Update iam_attributes.tf.erb to honor skip_test. * Don't reject skip_tests when example is nil. * Update mmv1/products/apigee/api.yaml Co-authored-by: Stephen Lewis (Burrows) <stephen.r.burrows@gmail.com> * Fix primary_resource_name for apigee organization name. * Add a new field "ipRange". Co-authored-by: Stephen Lewis (Burrows) <stephen.r.burrows@gmail.com> Signed-off-by: Modular Magician <magic-modules@google.com> Co-authored-by: Stephen Lewis (Burrows) <stephen.r.burrows@gmail.com>
- Loading branch information
1 parent
968ee03
commit ed35c1c
Showing
73 changed files
with
28,672 additions
and
1,354 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
```release-note:enhancement | ||
apigee: added ip_range field to `google_apigee_instance` | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package google | ||
|
||
import ( | ||
dcl "github.com/GoogleCloudPlatform/declarative-resource-client-library/dcl" | ||
) | ||
|
||
var ( | ||
// CreateDirective restricts Apply to creating resources for Create | ||
CreateDirective = []dcl.ApplyOption{ | ||
dcl.WithLifecycleParam(dcl.BlockAcquire), | ||
dcl.WithLifecycleParam(dcl.BlockDestruction), | ||
dcl.WithLifecycleParam(dcl.BlockModification), | ||
} | ||
|
||
// UpdateDirective restricts Apply to modifying resources for Update | ||
UpdateDirective = []dcl.ApplyOption{ | ||
dcl.WithLifecycleParam(dcl.BlockCreation), | ||
dcl.WithLifecycleParam(dcl.BlockDestruction), | ||
} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package google | ||
|
||
import ( | ||
"fmt" | ||
"log" | ||
) | ||
|
||
type dclLogger struct{} | ||
|
||
// Fatal records Fatal errors. | ||
func (l dclLogger) Fatal(args ...interface{}) { | ||
log.Fatal(args...) | ||
} | ||
|
||
// Fatalf records Fatal errors with added arguments. | ||
func (l dclLogger) Fatalf(format string, args ...interface{}) { | ||
log.Fatalf(fmt.Sprintf("[DEBUG][DCL FATAL] %s", format), args...) | ||
} | ||
|
||
// Info records Info errors. | ||
func (l dclLogger) Info(args ...interface{}) { | ||
log.Print(args...) | ||
} | ||
|
||
// Infof records Info errors with added arguments. | ||
func (l dclLogger) Infof(format string, args ...interface{}) { | ||
log.Printf(fmt.Sprintf("[DEBUG][DCL INFO] %s", format), args...) | ||
} | ||
|
||
// Warningf records Warning errors with added arguments. | ||
func (l dclLogger) Warningf(format string, args ...interface{}) { | ||
log.Printf(fmt.Sprintf("[DEBUG][DCL WARNING] %s", format), args...) | ||
} | ||
|
||
// Warning records Warning errors. | ||
func (l dclLogger) Warning(args ...interface{}) { | ||
log.Print(args...) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
package google | ||
|
||
import "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" | ||
|
||
func expandStringArray(v interface{}) []string { | ||
arr, ok := v.([]string) | ||
|
||
if ok { | ||
return arr | ||
} | ||
|
||
if arr, ok := v.(*schema.Set); ok { | ||
return convertStringSet(arr) | ||
} | ||
|
||
arr = convertStringArr(v.([]interface{})) | ||
if arr == nil { | ||
// Send empty array specifically instead of nil | ||
return make([]string, 0) | ||
} | ||
return arr | ||
} | ||
|
||
func expandIntegerArray(v interface{}) []int64 { | ||
arr, ok := v.([]int64) | ||
|
||
if ok { | ||
return arr | ||
} | ||
|
||
if arr, ok := v.(*schema.Set); ok { | ||
return convertIntegerSet(arr) | ||
} | ||
|
||
return convertIntegerArr(v.([]interface{})) | ||
} | ||
|
||
func convertIntegerSet(v *schema.Set) []int64 { | ||
return convertIntegerArr(v.List()) | ||
} | ||
|
||
func convertIntegerArr(v []interface{}) []int64 { | ||
var vi []int64 | ||
for _, vs := range v { | ||
vi = append(vi, int64(vs.(int))) | ||
} | ||
return vi | ||
} | ||
|
||
// Returns the DCL representation of a three-state boolean value represented by a string in terraform. | ||
func expandEnumBool(v interface{}) *bool { | ||
s, ok := v.(string) | ||
if !ok { | ||
return nil | ||
} | ||
switch s { | ||
case "TRUE": | ||
b := true | ||
return &b | ||
case "FALSE": | ||
b := false | ||
return &b | ||
} | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package google | ||
|
||
// Returns the terraform representation of a three-state boolean value represented by a pointer to bool in DCL. | ||
func flattenEnumBool(v interface{}) string { | ||
b, ok := v.(*bool) | ||
if !ok || b == nil { | ||
return "" | ||
} | ||
if *b { | ||
return "TRUE" | ||
} | ||
return "FALSE" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package google | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" | ||
) | ||
|
||
// OrgPolicyPolicy has a custom import method because the parent field needs to allow an additional forward slash | ||
// to represent the type of parent (e.g. projects/{project_id}). | ||
func resourceOrgPolicyPolicyCustomImport(d *schema.ResourceData, meta interface{}) error { | ||
config := meta.(*Config) | ||
if err := parseImportId([]string{ | ||
"^(?P<parent>[^/]+/?[^/]*)/policies/(?P<name>[^/]+)", | ||
"^(?P<parent>[^/]+/?[^/]*)/(?P<name>[^/]+)", | ||
}, d, config); err != nil { | ||
return err | ||
} | ||
|
||
// Replace import id for the resource id | ||
id, err := replaceVarsRecursive(d, config, "{{parent}}/policies/{{name}}", false, 0) | ||
if err != nil { | ||
return fmt.Errorf("Error constructing id: %s", err) | ||
} | ||
d.SetId(id) | ||
|
||
return nil | ||
} |
Oops, something went wrong.