Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Context Aware Access UserAccessBinding resource #2851

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/4368.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
accesscontextmanager: Added support for `google_access_context_manager_gcp_user_access_binding`
```
7 changes: 5 additions & 2 deletions google-beta/access_context_manager_operation.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,11 @@ func (w *AccessContextManagerOperationWaiter) QueryOp() (interface{}, error) {

func createAccessContextManagerWaiter(config *Config, op map[string]interface{}, activity, userAgent string) (*AccessContextManagerOperationWaiter, error) {
if val, ok := op["name"]; !ok || val == "" {
// This was a synchronous call - there is no operation to wait for.
return nil, nil
// An operation could also be indicated with a "metadata" field.
if _, ok := op["metadata"]; !ok {
// This was a synchronous call - there is no operation to wait for.
return nil, nil
}
}
w := &AccessContextManagerOperationWaiter{
Config: config,
Expand Down
7 changes: 5 additions & 2 deletions google-beta/active_directory_operation.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,11 @@ func (w *ActiveDirectoryOperationWaiter) QueryOp() (interface{}, error) {

func createActiveDirectoryWaiter(config *Config, op map[string]interface{}, project, activity, userAgent string) (*ActiveDirectoryOperationWaiter, error) {
if val, ok := op["name"]; !ok || val == "" {
// This was a synchronous call - there is no operation to wait for.
return nil, nil
// An operation could also be indicated with a "metadata" field.
if _, ok := op["metadata"]; !ok {
// This was a synchronous call - there is no operation to wait for.
return nil, nil
}
}
w := &ActiveDirectoryOperationWaiter{
Config: config,
Expand Down
7 changes: 5 additions & 2 deletions google-beta/api_gateway_operation.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,11 @@ func (w *ApiGatewayOperationWaiter) QueryOp() (interface{}, error) {

func createApiGatewayWaiter(config *Config, op map[string]interface{}, project, activity, userAgent string) (*ApiGatewayOperationWaiter, error) {
if val, ok := op["name"]; !ok || val == "" {
// This was a synchronous call - there is no operation to wait for.
return nil, nil
// An operation could also be indicated with a "metadata" field.
if _, ok := op["metadata"]; !ok {
// This was a synchronous call - there is no operation to wait for.
return nil, nil
}
}
w := &ApiGatewayOperationWaiter{
Config: config,
Expand Down
7 changes: 5 additions & 2 deletions google-beta/artifact_registry_operation.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,11 @@ func (w *ArtifactRegistryOperationWaiter) QueryOp() (interface{}, error) {

func createArtifactRegistryWaiter(config *Config, op map[string]interface{}, project, activity, userAgent string) (*ArtifactRegistryOperationWaiter, error) {
if val, ok := op["name"]; !ok || val == "" {
// This was a synchronous call - there is no operation to wait for.
return nil, nil
// An operation could also be indicated with a "metadata" field.
if _, ok := op["metadata"]; !ok {
// This was a synchronous call - there is no operation to wait for.
return nil, nil
}
}
w := &ArtifactRegistryOperationWaiter{
Config: config,
Expand Down
7 changes: 5 additions & 2 deletions google-beta/data_fusion_operation.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,11 @@ func (w *DataFusionOperationWaiter) QueryOp() (interface{}, error) {

func createDataFusionWaiter(config *Config, op map[string]interface{}, project, activity, userAgent string) (*DataFusionOperationWaiter, error) {
if val, ok := op["name"]; !ok || val == "" {
// This was a synchronous call - there is no operation to wait for.
return nil, nil
// An operation could also be indicated with a "metadata" field.
if _, ok := op["metadata"]; !ok {
// This was a synchronous call - there is no operation to wait for.
return nil, nil
}
}
w := &DataFusionOperationWaiter{
Config: config,
Expand Down
7 changes: 5 additions & 2 deletions google-beta/datastore_operation.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,11 @@ func (w *DatastoreOperationWaiter) QueryOp() (interface{}, error) {

func createDatastoreWaiter(config *Config, op map[string]interface{}, project, activity, userAgent string) (*DatastoreOperationWaiter, error) {
if val, ok := op["name"]; !ok || val == "" {
// This was a synchronous call - there is no operation to wait for.
return nil, nil
// An operation could also be indicated with a "metadata" field.
if _, ok := op["metadata"]; !ok {
// This was a synchronous call - there is no operation to wait for.
return nil, nil
}
}
w := &DatastoreOperationWaiter{
Config: config,
Expand Down
7 changes: 5 additions & 2 deletions google-beta/filestore_operation.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,11 @@ func (w *FilestoreOperationWaiter) QueryOp() (interface{}, error) {

func createFilestoreWaiter(config *Config, op map[string]interface{}, project, activity, userAgent string) (*FilestoreOperationWaiter, error) {
if val, ok := op["name"]; !ok || val == "" {
// This was a synchronous call - there is no operation to wait for.
return nil, nil
// An operation could also be indicated with a "metadata" field.
if _, ok := op["metadata"]; !ok {
// This was a synchronous call - there is no operation to wait for.
return nil, nil
}
}
w := &FilestoreOperationWaiter{
Config: config,
Expand Down
7 changes: 5 additions & 2 deletions google-beta/firebase_operation.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,11 @@ func (w *FirebaseOperationWaiter) QueryOp() (interface{}, error) {

func createFirebaseWaiter(config *Config, op map[string]interface{}, project, activity, userAgent string) (*FirebaseOperationWaiter, error) {
if val, ok := op["name"]; !ok || val == "" {
// This was a synchronous call - there is no operation to wait for.
return nil, nil
// An operation could also be indicated with a "metadata" field.
if _, ok := op["metadata"]; !ok {
// This was a synchronous call - there is no operation to wait for.
return nil, nil
}
}
w := &FirebaseOperationWaiter{
Config: config,
Expand Down
7 changes: 5 additions & 2 deletions google-beta/firestore_operation.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,11 @@ func (w *FirestoreOperationWaiter) QueryOp() (interface{}, error) {

func createFirestoreWaiter(config *Config, op map[string]interface{}, project, activity, userAgent string) (*FirestoreOperationWaiter, error) {
if val, ok := op["name"]; !ok || val == "" {
// This was a synchronous call - there is no operation to wait for.
return nil, nil
// An operation could also be indicated with a "metadata" field.
if _, ok := op["metadata"]; !ok {
// This was a synchronous call - there is no operation to wait for.
return nil, nil
}
}
w := &FirestoreOperationWaiter{
Config: config,
Expand Down
7 changes: 5 additions & 2 deletions google-beta/game_services_operation.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,11 @@ func (w *GameServicesOperationWaiter) QueryOp() (interface{}, error) {

func createGameServicesWaiter(config *Config, op map[string]interface{}, project, activity, userAgent string) (*GameServicesOperationWaiter, error) {
if val, ok := op["name"]; !ok || val == "" {
// This was a synchronous call - there is no operation to wait for.
return nil, nil
// An operation could also be indicated with a "metadata" field.
if _, ok := op["metadata"]; !ok {
// This was a synchronous call - there is no operation to wait for.
return nil, nil
}
}
w := &GameServicesOperationWaiter{
Config: config,
Expand Down
7 changes: 5 additions & 2 deletions google-beta/iam_beta_operation.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,11 @@ func (w *IAMBetaOperationWaiter) QueryOp() (interface{}, error) {

func createIAMBetaWaiter(config *Config, op map[string]interface{}, project, activity, userAgent string) (*IAMBetaOperationWaiter, error) {
if val, ok := op["name"]; !ok || val == "" {
// This was a synchronous call - there is no operation to wait for.
return nil, nil
// An operation could also be indicated with a "metadata" field.
if _, ok := op["metadata"]; !ok {
// This was a synchronous call - there is no operation to wait for.
return nil, nil
}
}
w := &IAMBetaOperationWaiter{
Config: config,
Expand Down
7 changes: 5 additions & 2 deletions google-beta/memcache_operation.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,11 @@ func (w *MemcacheOperationWaiter) QueryOp() (interface{}, error) {

func createMemcacheWaiter(config *Config, op map[string]interface{}, project, activity, userAgent string) (*MemcacheOperationWaiter, error) {
if val, ok := op["name"]; !ok || val == "" {
// This was a synchronous call - there is no operation to wait for.
return nil, nil
// An operation could also be indicated with a "metadata" field.
if _, ok := op["metadata"]; !ok {
// This was a synchronous call - there is no operation to wait for.
return nil, nil
}
}
w := &MemcacheOperationWaiter{
Config: config,
Expand Down
7 changes: 5 additions & 2 deletions google-beta/ml_engine_operation.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,11 @@ func (w *MLEngineOperationWaiter) QueryOp() (interface{}, error) {

func createMLEngineWaiter(config *Config, op map[string]interface{}, project, activity, userAgent string) (*MLEngineOperationWaiter, error) {
if val, ok := op["name"]; !ok || val == "" {
// This was a synchronous call - there is no operation to wait for.
return nil, nil
// An operation could also be indicated with a "metadata" field.
if _, ok := op["metadata"]; !ok {
// This was a synchronous call - there is no operation to wait for.
return nil, nil
}
}
w := &MLEngineOperationWaiter{
Config: config,
Expand Down
7 changes: 5 additions & 2 deletions google-beta/network_management_operation.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,11 @@ func (w *NetworkManagementOperationWaiter) QueryOp() (interface{}, error) {

func createNetworkManagementWaiter(config *Config, op map[string]interface{}, project, activity, userAgent string) (*NetworkManagementOperationWaiter, error) {
if val, ok := op["name"]; !ok || val == "" {
// This was a synchronous call - there is no operation to wait for.
return nil, nil
// An operation could also be indicated with a "metadata" field.
if _, ok := op["metadata"]; !ok {
// This was a synchronous call - there is no operation to wait for.
return nil, nil
}
}
w := &NetworkManagementOperationWaiter{
Config: config,
Expand Down
7 changes: 5 additions & 2 deletions google-beta/notebooks_operation.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,11 @@ func (w *NotebooksOperationWaiter) QueryOp() (interface{}, error) {

func createNotebooksWaiter(config *Config, op map[string]interface{}, project, activity, userAgent string) (*NotebooksOperationWaiter, error) {
if val, ok := op["name"]; !ok || val == "" {
// This was a synchronous call - there is no operation to wait for.
return nil, nil
// An operation could also be indicated with a "metadata" field.
if _, ok := op["metadata"]; !ok {
// This was a synchronous call - there is no operation to wait for.
return nil, nil
}
}
w := &NotebooksOperationWaiter{
Config: config,
Expand Down
5 changes: 3 additions & 2 deletions google-beta/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -781,9 +781,9 @@ func Provider() *schema.Provider {
return provider
}

// Generated resources: 204
// Generated resources: 205
// Generated IAM resources: 105
// Total generated resources: 309
// Total generated resources: 310
func ResourceMap() map[string]*schema.Resource {
resourceMap, _ := ResourceMapWithErrors()
return resourceMap
Expand All @@ -802,6 +802,7 @@ func ResourceMapWithErrors() (map[string]*schema.Resource, error) {
"google_access_context_manager_service_perimeter": resourceAccessContextManagerServicePerimeter(),
"google_access_context_manager_service_perimeters": resourceAccessContextManagerServicePerimeters(),
"google_access_context_manager_service_perimeter_resource": resourceAccessContextManagerServicePerimeterResource(),
"google_access_context_manager_gcp_user_access_binding": resourceAccessContextManagerGcpUserAccessBinding(),
"google_active_directory_domain": resourceActiveDirectoryDomain(),
"google_active_directory_domain_trust": resourceActiveDirectoryDomainTrust(),
"google_api_gateway_api": resourceApiGatewayApi(),
Expand Down
7 changes: 5 additions & 2 deletions google-beta/redis_operation.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,11 @@ func (w *RedisOperationWaiter) QueryOp() (interface{}, error) {

func createRedisWaiter(config *Config, op map[string]interface{}, project, activity, userAgent string) (*RedisOperationWaiter, error) {
if val, ok := op["name"]; !ok || val == "" {
// This was a synchronous call - there is no operation to wait for.
return nil, nil
// An operation could also be indicated with a "metadata" field.
if _, ok := op["metadata"]; !ok {
// This was a synchronous call - there is no operation to wait for.
return nil, nil
}
}
w := &RedisOperationWaiter{
Config: config,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
)

// Since access approval settings are heirarchical, and only one can exist per folder/project/org,
// and all refer to the same organization, they need to be ran serially
// and all refer to the same organization, they need to be run serially
// See AccessApprovalOrganizationSettings for the test runner.
func testAccAccessApprovalFolderSettings(t *testing.T) {
context := map[string]interface{}{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
)

// Since access approval settings are heirarchical, and only one can exist per folder/project/org,
// and all refer to the same organization, they need to be ran serially
// and all refer to the same organization, they need to be run serially
func TestAccAccessApprovalSettings(t *testing.T) {
testCases := map[string]func(t *testing.T){
"folder": testAccAccessApprovalFolderSettings,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
)

// Since access approval settings are heirarchical, and only one can exist per folder/project/org,
// and all refer to the same organization, they need to be ran serially.
// and all refer to the same organization, they need to be run serially.
// See AccessApprovalOrganizationSettings for the test runner.
func testAccAccessApprovalProjectSettings(t *testing.T) {
context := map[string]interface{}{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
)

// Since each test here is acting on the same organization and only one AccessPolicy
// can exist, they need to be ran serially. See AccessPolicy for the test runner.
// can exist, they need to be run serially. See AccessPolicy for the test runner.

func testAccAccessContextManagerAccessLevelCondition_basicTest(t *testing.T) {
org := getTestOrgFromEnv(t)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

// Since each test here is acting on the same organization and only one AccessPolicy
// can exist, they need to be ran serially. See AccessPolicy for the test runner.
// can exist, they need to be run serially. See AccessPolicy for the test runner.

func testAccAccessContextManagerAccessLevel_basicTest(t *testing.T) {
org := getTestOrgFromEnv(t)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

// Since each test here is acting on the same organization and only one AccessPolicy
// can exist, they need to be ran serially. See AccessPolicy for the test runner.
// can exist, they need to be run serially. See AccessPolicy for the test runner.

func testAccAccessContextManagerAccessLevels_basicTest(t *testing.T) {
org := getTestOrgFromEnv(t)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func testSweepAccessContextManagerPolicies(region string) error {
}

// Since each test here is acting on the same organization and only one AccessPolicy
// can exist, they need to be ran serially
// can exist, they need to be run serially
func TestAccAccessContextManager(t *testing.T) {
testCases := map[string]func(t *testing.T){
"access_policy": testAccAccessContextManagerAccessPolicy_basicTest,
Expand All @@ -87,6 +87,7 @@ func TestAccAccessContextManager(t *testing.T) {
"access_levels": testAccAccessContextManagerAccessLevels_basicTest,
"access_level_condition": testAccAccessContextManagerAccessLevelCondition_basicTest,
"service_perimeters": testAccAccessContextManagerServicePerimeters_basicTest,
"gcp_user_access_binding": testAccAccessContextManagerGcpUserAccessBinding_basicTest,
}

for name, tc := range testCases {
Expand Down
Loading