Skip to content
Open
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
60 changes: 60 additions & 0 deletions docs/data-sources/containerregistry_artifactories.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "stackit_containerregistry_artifactories Data Source - stackit"
subcategory: ""
description: |-
Container registry artifactories list data source schema.
---

# stackit_containerregistry_artifactories (Data Source)

Container registry artifactories list data source schema.

## Example Usage

```terraform
locals {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

data "stackit_containerregistry_artifactories" "this" {
project_id = local.project_id
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `project_id` (String) STACKIT project ID to which the container registry artifactories are associated.

### Optional

- `region` (String) STACKIT region where the container registry artifactories are located. If not defined, the provider default_region is used.

### Read-Only

- `artifactories` (Attributes List) List of container registry artifactories. (see [below for nested schema](#nestedatt--artifactories))
- `id` (String) Terraform's internal data source ID, structured as `project_id`,`region`.

<a id="nestedatt--artifactories"></a>
### Nested Schema for `artifactories`

Read-Only:

- `artifactory_id` (String) The unique identifier of the container registry artifactory.
- `create_time` (String) The date and time the creation of the STACKIT artifactory was triggered.
- `name` (String) A user-chosen name to distinguish multiple STACKIT artifactories.
- `proxy` (Attributes) Proxy configuration if this artifactory is created as a proxy-cache for an upstream registry. (see [below for nested schema](#nestedatt--artifactories--proxy))
- `state` (String) The current state of the STACKIT artifactory.
- `url` (String) The base URL of the STACKIT artifactory.

<a id="nestedatt--artifactories--proxy"></a>
### Nested Schema for `artifactories.proxy`

Read-Only:

- `description` (String) Description of the upstream registry.
- `registry_type` (String) Which replication adapter to use for this registry.
- `url` (String) Upstream registry URL to proxy.
55 changes: 55 additions & 0 deletions docs/data-sources/containerregistry_artifactory.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "stackit_containerregistry_artifactory Data Source - stackit"
subcategory: ""
description: |-
Container registry artifactory data source schema.
---

# stackit_containerregistry_artifactory (Data Source)

Container registry artifactory data source schema.

## Example Usage

```terraform
locals {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
artifactory_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

data "stackit_containerregistry_artifactory" "this" {
project_id = local.project_id
artifactory_id = local.artifactory_id
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `artifactory_id` (String) The unique identifier of the container registry artifactory.
- `project_id` (String) STACKIT project ID to which the container registry artifactory is associated.

### Optional

- `region` (String) STACKIT region where the container registry artifactory is located. If not defined, the provider default_region is used.

### Read-Only

- `create_time` (String) The date and time the creation of the STACKIT artifactory was triggered.
- `id` (String) Terraform's internal resource ID, structured as `project_id`,`region`,`artifactory_id`.
- `name` (String) A user-chosen name to distinguish multiple STACKIT artifactories.
- `proxy` (Attributes) Proxy configuration if this artifactory is created as a proxy-cache for an upstream registry. (see [below for nested schema](#nestedatt--proxy))
- `state` (String) The current state of the STACKIT artifactory.
- `url` (String) The base URL of the STACKIT artifactory.

<a id="nestedatt--proxy"></a>
### Nested Schema for `proxy`

Read-Only:

- `description` (String) Description of the upstream registry.
- `registry_type` (String) Which replication adapter to use for this registry.
- `url` (String) Upstream registry URL to proxy.
48 changes: 48 additions & 0 deletions docs/data-sources/containerregistry_replication_adapters.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "stackit_containerregistry_replication_adapters Data Source - stackit"
subcategory: ""
description: |-
Container registry replication adapters data source schema.
---

# stackit_containerregistry_replication_adapters (Data Source)

Container registry replication adapters data source schema.

## Example Usage

```terraform
locals {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

data "stackit_containerregistry_replication_adapters" "this" {
project_id = local.project_id
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `project_id` (String) STACKIT project ID to which the replication adapters are associated.

### Optional

- `region` (String) STACKIT region where the replication adapters are located. If not defined, the provider default_region is used.

### Read-Only

- `id` (String) Terraform's internal data source ID, structured as `project_id`,`region`.
- `replication_adapters` (Attributes List) List of supported replication adapters. (see [below for nested schema](#nestedatt--replication_adapters))

<a id="nestedatt--replication_adapters"></a>
### Nested Schema for `replication_adapters`

Read-Only:

- `credential_type` (String) User-hint for what type of credentials are expected for the replication adapter type.
- `display_name` (String) Human-friendly name of the provider the adapter relates to.
- `registry_type` (String) Identifies the replication adapter.
1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ See this [example](https://professional-service.git.onstackit.cloud/professional
- `authorization_custom_endpoint` (String) Custom endpoint for the Membership service
- `automation_custom_endpoint` (String) Custom endpoint for the Automation service
- `cdn_custom_endpoint` (String) Custom endpoint for the CDN service
- `container_registry_custom_endpoint` (String) Custom endpoint for the Container Registry service
- `credentials_path` (String) Path of JSON from where the credentials are read. Takes precedence over the env var `STACKIT_CREDENTIALS_PATH`. Default value is `~/.stackit/credentials.json`.
- `default_region` (String) Region will be used as the default location for regional services. Not all services require a region, some are global
- `dns_custom_endpoint` (String) Custom endpoint for the DNS service
Expand Down
106 changes: 106 additions & 0 deletions docs/resources/containerregistry_artifactory.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "stackit_containerregistry_artifactory Resource - stackit"
subcategory: ""
description: |-
Container registry artifactory resource schema.
---

# stackit_containerregistry_artifactory (Resource)

Container registry artifactory resource schema.

## Example Usage

```terraform
locals {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
region = "eu01"
name = "my-registry"
}

# Standard container registry artifactory
resource "stackit_containerregistry_artifactory" "this" {
project_id = local.project_id
name = local.name
}

# Container registry artifactory configured as a Docker Hub proxy-cache with write-only credentials
resource "stackit_containerregistry_artifactory" "docker_hub_proxy" {
project_id = local.project_id
name = "my-docker-hub-mirror"

proxy = {
registry_type = "docker-hub"
url = "https://registry-1.docker.io"
description = "Docker Hub pull-through cache"

credentials = {
access_key = "my-dockerhub-username"
access_secret_wo = "my-dockerhub-access-token"
access_secret_wo_version = 1
}
}
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `name` (String) A user-chosen name to distinguish multiple STACKIT artifactories.
- `project_id` (String) STACKIT project ID to which the container registry artifactory is associated.

### Optional

- `proxy` (Attributes) Proxy configuration if this artifactory is created as a proxy-cache for an upstream registry. (see [below for nested schema](#nestedatt--proxy))
- `region` (String) STACKIT region where the container registry artifactory is located. If not defined, the provider default_region is used.

### Read-Only

- `artifactory_id` (String) The unique identifier of the container registry artifactory.
- `create_time` (String) The date and time the creation of the STACKIT artifactory was triggered.
- `id` (String) Terraform's internal resource ID, structured as `project_id`,`region`,`artifactory_id`.
- `state` (String) The current state of the STACKIT artifactory.
- `url` (String) The base URL of the STACKIT artifactory.

<a id="nestedatt--proxy"></a>
### Nested Schema for `proxy`

Required:

- `registry_type` (String) Which replication adapter to use for this registry.
- `url` (String) Upstream registry URL to proxy.

Optional:

- `credentials` (Attributes) Credentials for the upstream registry. (see [below for nested schema](#nestedatt--proxy--credentials))
- `description` (String) Description of the upstream registry.

<a id="nestedatt--proxy--credentials"></a>
### Nested Schema for `proxy.credentials`

Required:

- `access_key` (String) Access key or username for the upstream registry.

Optional:

- `access_secret` (String, Sensitive) Access secret or password for the upstream registry. Write-only argument `access_secret_wo` should be preferred.
- `access_secret_wo` (String, Sensitive, [Write-only](https://developer.hashicorp.com/terraform/language/resources/ephemeral#write-only-arguments)) Write-only access secret or password for the upstream registry - never stored in state and never returned by the API. To rotate the secret, update this value AND increment `access_secret_wo_version`. Changing this field alone will NOT trigger an update.
- `access_secret_wo_version` (Number) User-managed rotation counter for `access_secret_wo`. Must be incremented every time `access_secret_wo` is updated.

## Import

Import is supported using the following syntax:

In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example:

```terraform
# Only use the import statement if you want to import an existing Container Registry artifactory
import {
to = stackit_containerregistry_artifactory.this
id = "${local.project_id},${local.region},ARTIFACTORY_ID"
}
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
locals {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

data "stackit_containerregistry_artifactories" "this" {
project_id = local.project_id
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
locals {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
artifactory_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

data "stackit_containerregistry_artifactory" "this" {
project_id = local.project_id
artifactory_id = local.artifactory_id
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
locals {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

data "stackit_containerregistry_replication_adapters" "this" {
project_id = local.project_id
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Only use the import statement if you want to import an existing Container Registry artifactory
import {
to = stackit_containerregistry_artifactory.this
id = "${local.project_id},${local.region},ARTIFACTORY_ID"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
locals {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
region = "eu01"
name = "my-registry"
}

# Standard container registry artifactory
resource "stackit_containerregistry_artifactory" "this" {
project_id = local.project_id
name = local.name
}

# Container registry artifactory configured as a Docker Hub proxy-cache with write-only credentials
resource "stackit_containerregistry_artifactory" "docker_hub_proxy" {
project_id = local.project_id
name = "my-docker-hub-mirror"

proxy = {
registry_type = "docker-hub"
url = "https://registry-1.docker.io"
description = "Docker Hub pull-through cache"

credentials = {
access_key = "my-dockerhub-username"
access_secret_wo = "my-dockerhub-access-token"
access_secret_wo_version = 1
}
}
}
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ require (
github.com/stackitcloud/stackit-sdk-go/services/postgresflex v1.16.0
github.com/stackitcloud/stackit-sdk-go/services/rabbitmq v1.5.0
github.com/stackitcloud/stackit-sdk-go/services/redis v1.6.0
github.com/stackitcloud/stackit-sdk-go/services/registry v0.3.0
github.com/stackitcloud/stackit-sdk-go/services/resourcemanager v0.28.0
github.com/stackitcloud/stackit-sdk-go/services/scf v0.11.0
github.com/stackitcloud/stackit-sdk-go/services/secretsmanager v0.20.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ github.com/stackitcloud/stackit-sdk-go/services/rabbitmq v1.5.0 h1:SAro5TWVJDDyi
github.com/stackitcloud/stackit-sdk-go/services/rabbitmq v1.5.0/go.mod h1:mjYkyr/A/+9rZnX5IOLEoAMFqHsRCIToZWpsYzYBwWo=
github.com/stackitcloud/stackit-sdk-go/services/redis v1.6.0 h1:5UEPilI+RCuXEM8jm4ibREoZAsSAGI1+KnJ0oapye7Q=
github.com/stackitcloud/stackit-sdk-go/services/redis v1.6.0/go.mod h1:/wE98YN+s1s1OcaEPt8Z2xO0Y46Gur3nXlg1AiiMNeY=
github.com/stackitcloud/stackit-sdk-go/services/registry v0.3.0 h1:2yKVVSeISuJiIY0Yi8TK7SdtMEqwZM2Ol2YQqs3GZ4Y=
github.com/stackitcloud/stackit-sdk-go/services/registry v0.3.0/go.mod h1:9ew0RfPiwsDbd2OApdaAfTJgZyJbtKKP63NNZz3RWBQ=
github.com/stackitcloud/stackit-sdk-go/services/resourcemanager v0.28.0 h1:rZB1f9g5M/2mWKXsJIfMvGcFpFWkDQFjG28V/d1ezWw=
github.com/stackitcloud/stackit-sdk-go/services/resourcemanager v0.28.0/go.mod h1:IsId3wbkp5oaO0JEaHZpZnbVW6KFHlAptwB+1iG3v3w=
github.com/stackitcloud/stackit-sdk-go/services/scf v0.11.0 h1:tdRyQFfGHFiXNhURdHSdesh7ym3y2R9A39B4ywj2Coc=
Expand Down
10 changes: 10 additions & 0 deletions stackit/internal/core/clienttestutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
postgresflex "github.com/stackitcloud/stackit-sdk-go/services/postgresflex/v3api"
rabbitmq "github.com/stackitcloud/stackit-sdk-go/services/rabbitmq/v2api"
redis "github.com/stackitcloud/stackit-sdk-go/services/redis/v2api"
registry "github.com/stackitcloud/stackit-sdk-go/services/registry/v1api"
resourcemanager "github.com/stackitcloud/stackit-sdk-go/services/resourcemanager/v0api"
scf "github.com/stackitcloud/stackit-sdk-go/services/scf/v1api"
secretsmanagerV1Alpha "github.com/stackitcloud/stackit-sdk-go/services/secretsmanager/v1alphaapi"
Expand All @@ -54,6 +55,7 @@ type MockClientFactory struct {
AlbWafV1ClientMock albWaf.DefaultAPI
AuthorizationV2ClientMock authorization.DefaultAPI
CdnV1ClientMock cdnSdk.DefaultAPI
ContainerRegistryV1ClientMock registry.DefaultAPI
DnsV1ClientMock dns.DefaultAPI
DremioV2BetaClientMock dremioSdk.DefaultAPI
EdgeV1ClientMock edge.DefaultAPI
Expand Down Expand Up @@ -324,6 +326,14 @@ func (m *MockClientFactory) newCdnV1Client() (cdnSdk.DefaultAPI, error) {
return cdnSdk.DefaultAPIServiceMock{}, nil
}

func (m *MockClientFactory) newContainerRegistryV1Client() (registry.DefaultAPI, error) {
if m.ContainerRegistryV1ClientMock != nil {
return m.ContainerRegistryV1ClientMock, nil
}

return registry.DefaultAPIServiceMock{}, nil
}

func (m *MockClientFactory) newIaaSV2AlphaClient() (iaasV2Alpha.DefaultAPI, error) {
if m.IaaSV2ClientMock != nil {
return m.IaasV2AlphaClientMock, nil
Expand Down
Loading