Skip to content
147 changes: 147 additions & 0 deletions mmv1/products/storageftp/Server.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
# Copyright 2026 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

---
name: 'Server'
kind: 'storageftp#server'
min_version: beta
description: |
An SFTP Server resource supporting internal and external connectivity configurations.
base_url: 'projects/{{project}}/locations/{{location}}/servers'
self_link: 'projects/{{project}}/locations/{{location}}/servers/{{server_id}}'
create_url: 'projects/{{project}}/locations/{{location}}/servers?serverId={{server_id}}'
id_format: 'projects/{{project}}/locations/{{location}}/servers/{{server_id}}'
import_format:
- 'projects/{{project}}/locations/{{location}}/servers/{{server_id}}'
update_verb: 'PATCH'
update_mask: true
timeouts:
insert_minutes: 20
update_minutes: 20
delete_minutes: 20
async:
type: 'OpAsync'
operation:
base_url: '{{op_id}}'
actions: ['create', 'delete', 'update']
autogen_async: true
custom_code:
constants: 'templates/terraform/constants/storage_ftp_server.go.tmpl'
samples:
- name: 'storage_ftp_server_internal'
min_version: beta
primary_resource_id: 'internal_server'
steps:
- name: 'storage_ftp_server_internal'
min_version: beta
resource_id_vars:
server_id: 'sftp-int'
- name: 'storage_ftp_server_external'
min_version: beta
primary_resource_id: 'external_server'
steps:
- name: 'storage_ftp_server_external'
min_version: beta
resource_id_vars:
server_id: 'sftp-ext'
parameters:
- name: 'location'
type: String
description: |
The location (region) of the Storage FTP Server.
required: true
immutable: true
url_param_only: true
- name: 'serverId'
type: String
description: |
A unique ID for the server. Must start with a lowercase letter, and end with a lowercase letter or number. Can contain lowercase letters, numbers, and hyphens. Maximum 30 characters.
required: true
immutable: true
max_size: 30
url_param_only: true
validation:
regex: '^[a-z0-9\-]{0,30}$'
properties:
- name: 'displayName'
type: String
description: |
A display name for the server.
required: false
- name: 'accessType'
type: Enum
description: |
The access type for this SFTP server. Possible values: INTERNAL, EXTERNAL
required: true
enum_values:
- 'INTERNAL'
- 'EXTERNAL'
- name: 'internalConfig'
type: NestedObject
description: |
Configuration for internal access type SFTP servers.
exactly_one_of:
- 'internal_config'
- 'external_config'
properties:
- name: 'consumerAcceptList'
type: Array
is_set: true
set_hash_func: 'resourceStorageFtpServerConsumerAcceptListHash'
send_empty_value: true
description: |
A list of consumer projects that are allowed to connect to this server.
item_type:
type: NestedObject
properties:
- name: 'project'
type: String
description: |
The project that is allowed to connect, in the format `projects/{project}`.
required: true
- name: 'connectionLimit'
type: Integer
description: |
The maximum number of Private Service Connect endpoints that can be created in the consumer project.
required: true
- name: 'consumerRejectList'
type: Array
is_set: true
set_hash_func: 'resourceStorageFtpServerConsumerRejectListHash'
send_empty_value: true
description: |
A list of consumer projects that are rejected from connecting to this server.
item_type:
type: NestedObject
properties:
- name: 'project'
type: String
description: |
The project that is rejected from connecting, in the format `projects/{project}`.
required: true
- name: 'externalConfig'
type: NestedObject
description: |
Configuration for external access type SFTP servers.
exactly_one_of:
- 'internal_config'
- 'external_config'
properties:
- name: 'allowedCidrBlocks'
type: Array
is_set: true
min_size: 1
description: |
A list of allowed IPv4 or IPv6 CIDR block ranges that can connect to this server.
item_type:
type: String
23 changes: 23 additions & 0 deletions mmv1/products/storageftp/product.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2026 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

---
name: StorageFtp
display_name: Cloud Storage FTP
scopes:
- https://www.googleapis.com/auth/cloud-platform
versions:
- name: beta
base_url: https://ftp.googleapis.com/v1alpha/
- name: ga
base_url: https://ftp.googleapis.com/v1alpha/
38 changes: 38 additions & 0 deletions mmv1/templates/terraform/constants/storage_ftp_server.go.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{{/*
The license inside this block applies to this file
Copyright 2026 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/ -}}

func resourceStorageFtpServerConsumerAcceptListHash(v interface{}) int {
if v == nil {
return 0
}

m, ok := v.(map[string]interface{})
if !ok {
return 0
}

return tpgresource.Hashcode(fmt.Sprintf("%v-%v", m["project"], m["connection_limit"]))
}

func resourceStorageFtpServerConsumerRejectListHash(v interface{}) int {
if v == nil {
return 0
}

m, ok := v.(map[string]interface{})
if !ok {
return 0
}

return tpgresource.Hashcode(fmt.Sprintf("%v", m["project"]))
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
resource "google_storage_ftp_server" "{{$.PrimaryResourceId}}" {
provider = google-beta
location = "us-west1"
server_id = "{{index $.ResourceIdVars "server_id"}}"
display_name = "My SFTP Server"
access_type = "EXTERNAL"

external_config {
allowed_cidr_blocks = [
"192.168.1.0/24",
"10.0.0.0/8"
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
resource "google_storage_ftp_server" "{{$.PrimaryResourceId}}" {
provider = google-beta
location = "us-west1"
server_id = "{{index $.ResourceIdVars "server_id"}}"
display_name = "My SFTP Server"
access_type = "INTERNAL"

internal_config {
consumer_accept_list {
project = "projects/${data.google_project.project.project_id}"
connection_limit = 10
}
consumer_reject_list {
project = "projects/${data.google_project.project.number}"
}
consumer_reject_list {
project = "projects/920946329098"
}
}
}

data "google_project" "project" {
provider = google-beta
}
Original file line number Diff line number Diff line change
Expand Up @@ -881,6 +881,11 @@ var ServicesListBeta = mapOf(
"displayName" to "Storagecontrol",
"path" to "./google-beta/services/storagecontrol"
),
"storageftp" to mapOf(
"name" to "storageftp",
"displayName" to "Storageftp",
"path" to "./google-beta/services/storageftp"
),
"storageinsights" to mapOf(
"name" to "storageinsights",
"displayName" to "Storageinsights",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -876,6 +876,11 @@ var ServicesListGa = mapOf(
"displayName" to "Storagecontrol",
"path" to "./google/services/storagecontrol"
),
"storageftp" to mapOf(
"name" to "storageftp",
"displayName" to "Storageftp",
"path" to "./google/services/storageftp"
),
"storageinsights" to mapOf(
"name" to "storageinsights",
"displayName" to "Storageinsights",
Expand Down
Loading
Loading