Skip to content

Commit

Permalink
New fields: enable_private_environment, enable_private_builds_only (#…
Browse files Browse the repository at this point in the history
…9689) (#17034)

* add enable_private_environment and enable_private_builds_only configs

* add tests

* correction in config name

* remove unnecessary checks

* case that PrivateEnvironmentConfig is nil

* add edge case tests for composer 3

* make new fields beta only

* add docs

* correct merge mistake

* avoid false negative for enablePrivateEnvironment

* check image version to avoid overriding EnablePrivateEnvironment

* minor fixes

* simplify code
[upstream:8df5516b9f3d17877b0cd046563352c0ded6c2a1]

Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician authored Jan 17, 2024
1 parent 8940912 commit 9c3a022
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .changelog/9689.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
composer: added fields `enable_private_environment` and `enable_private_builds_only` to `google_composer_environment`
```
5 changes: 5 additions & 0 deletions google/services/composer/resource_composer_environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -2485,3 +2485,8 @@ func versionsEqual(old, new string) (bool, error) {
}
return o.Equal(n), nil
}

func isComposer3(d *schema.ResourceData, config *transport_tpg.Config) bool {
image_version := d.Get("config.0.software_config.0.image_version").(string)
return strings.Contains(image_version, "composer-3")
}
9 changes: 9 additions & 0 deletions website/docs/r/composer_environment.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,15 @@ The following arguments are supported:
(Optional)
The configuration used for the Private IP Cloud Composer environment. Structure is [documented below](#nested_private_environment_config).

* `enable_private_environment` -
(Optional, [Beta](https://terraform.io/docs/providers/google/guides/provider_versions.html), Cloud Composer 3 only)
If true, a private Composer environment will be created.

* `enable_private_builds_only` -
(Optional, [Beta](https://terraform.io/docs/providers/google/guides/provider_versions.html), Cloud Composer 3 only)
If true, builds performed during operations that install Python packages have only private connectivity to Google services.
If false, the builds also have access to the internet.

* `web_server_network_access_control` -
The network-level access control policy for the Airflow web server.
If unspecified, no network-level access restrictions are applied.
Expand Down

0 comments on commit 9c3a022

Please sign in to comment.