Skip to content

Commit 0f6a8b4

Browse files
Merge remote-tracking branch 'upstream/main'
2 parents ac05133 + 5c433e8 commit 0f6a8b4

416 files changed

Lines changed: 29704 additions & 7935 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/dependabot.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "gomod"
4+
directory: "/"
5+
schedule:
6+
interval: "daily"
7+
cooldown:
8+
default-days: 7
9+
exclude: ["github.com/stackitcloud*"]
10+
- package-ecosystem: "github-actions"
11+
directory: "/"
12+
schedule:
13+
interval: "daily"
14+
cooldown:
15+
default-days: 7

.github/docs/contribution-guide/resource.go

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,9 @@ func (r *barResource) Create(ctx context.Context, req resource.CreateRequest, re
184184
if resp.Diagnostics.HasError() {
185185
return
186186
}
187+
188+
ctx = core.InitProviderContext(ctx)
189+
187190
projectId := model.ProjectId.ValueString()
188191
region := model.Region.ValueString() // not needed for global APIs
189192
ctx = tflog.SetField(ctx, "project_id", projectId)
@@ -203,10 +206,12 @@ func (r *barResource) Create(ctx context.Context, req resource.CreateRequest, re
203206
return
204207
}
205208

209+
ctx = core.LogResponse(ctx)
210+
206211
// only in case the create bar API call is asynchronous (Make sure to include *ALL* fields which are part of the
207212
// internal terraform resource id! And please include the comment below in your code):
208213
// Write id attributes to state before polling via the wait handler - just in case anything goes wrong during the wait handler
209-
utils.SetAndLogStateFields(ctx, &resp.Diagnostics, &resp.State, map[string]interface{}{
214+
ctx = utils.SetAndLogStateFields(ctx, &resp.Diagnostics, &resp.State, map[string]interface{}{
210215
"project_id": projectId,
211216
"region": region,
212217
"bar_id": resp.BarId,
@@ -244,6 +249,9 @@ func (r *barResource) Read(ctx context.Context, req resource.ReadRequest, resp *
244249
if resp.Diagnostics.HasError() {
245250
return
246251
}
252+
253+
ctx = core.InitProviderContext(ctx)
254+
247255
projectId := model.ProjectId.ValueString()
248256
region := r.providerData.GetRegionWithOverride(model.Region)
249257
barId := model.BarId.ValueString()
@@ -257,6 +265,8 @@ func (r *barResource) Read(ctx context.Context, req resource.ReadRequest, resp *
257265
return
258266
}
259267

268+
ctx = core.LogResponse(ctx)
269+
260270
// Map response body to schema
261271
err = mapFields(barResp, &model)
262272
if err != nil {
@@ -285,6 +295,9 @@ func (r *barResource) Delete(ctx context.Context, req resource.DeleteRequest, re
285295
if resp.Diagnostics.HasError() {
286296
return
287297
}
298+
299+
ctx = core.InitProviderContext(ctx)
300+
288301
projectId := model.ProjectId.ValueString()
289302
region := model.Region.ValueString()
290303
barId := model.BarId.ValueString()
@@ -298,6 +311,8 @@ func (r *barResource) Delete(ctx context.Context, req resource.DeleteRequest, re
298311
core.LogAndAddError(ctx, &resp.Diagnostics, "Error deleting bar", fmt.Sprintf("Calling API: %v", err))
299312
}
300313

314+
ctx = core.LogResponse(ctx)
315+
301316
// only in case the bar delete API endpoint is asynchronous: use a wait handler to wait for the delete operation to complete
302317
_, err = wait.DeleteBarWaitHandler(ctx, r.client, projectId, region, barId).WaitWithContext(ctx)
303318
if err != nil {
@@ -320,7 +335,7 @@ func (r *barResource) ImportState(ctx context.Context, req resource.ImportStateR
320335
return
321336
}
322337

323-
utils.SetAndLogStateFields(ctx, &resp.Diagnostics, &resp.State, map[string]any{
338+
ctx = utils.SetAndLogStateFields(ctx, &resp.Diagnostics, &resp.State, map[string]any{
324339
"project_id": idParts[0],
325340
"region": idParts[1],
326341
"bar_id": idParts[2],

.github/renovate.json

Lines changed: 0 additions & 15 deletions
This file was deleted.

.github/workflows/ci.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ jobs:
1818
runs-on: ubuntu-latest
1919
steps:
2020
- name: Checkout
21-
uses: actions/checkout@v4
21+
uses: actions/checkout@v6
2222

2323
- name: Build
2424
uses: ./.github/actions/build
2525
with:
2626
go-version: ${{ env.GO_VERSION }}
2727

2828
- name: Setup Terraform
29-
uses: hashicorp/setup-terraform@v2
29+
uses: hashicorp/setup-terraform@v3
3030
with:
3131
terraform_wrapper: false
3232

@@ -42,7 +42,7 @@ jobs:
4242

4343

4444
- name: Archive code coverage results
45-
uses: actions/upload-artifact@v4
45+
uses: actions/upload-artifact@v6
4646
with:
4747
name: ${{ env.CODE_COVERAGE_ARTIFACT_NAME }}
4848
path: "stackit/${{ env.CODE_COVERAGE_FILE_NAME }}"
@@ -54,7 +54,7 @@ jobs:
5454
runs-on: ubuntu-latest
5555
steps:
5656
- name: Checkout
57-
uses: actions/checkout@v4
57+
uses: actions/checkout@v6
5858

5959
- name: Check GoReleaser
6060
uses: goreleaser/goreleaser-action@v6

.github/workflows/release.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ jobs:
1818
goreleaser:
1919
runs-on: ubuntu-latest
2020
steps:
21-
- uses: actions/checkout@v4
21+
- uses: actions/checkout@v6
2222
with:
2323
# Allow goreleaser to access older tag information.
2424
fetch-depth: 0
25-
- uses: actions/setup-go@v5
25+
- uses: actions/setup-go@v6
2626
with:
2727
go-version-file: "go.mod"
2828
cache: true

.github/workflows/renovate.yaml

Lines changed: 0 additions & 19 deletions
This file was deleted.

.github/workflows/stale.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ on:
1111
env:
1212
DAYS_BEFORE_PR_STALE: 7
1313
DAYS_BEFORE_PR_CLOSE: 7
14+
EXEMPT_PR_LABELS: "ignore-stale"
1415

1516
permissions:
1617
issues: write
@@ -23,13 +24,14 @@ jobs:
2324
timeout-minutes: 10
2425
steps:
2526
- name: "Mark old PRs as stale"
26-
uses: actions/stale@v9
27+
uses: actions/stale@v10
2728
with:
2829
repo-token: ${{ secrets.GITHUB_TOKEN }}
2930
stale-pr-message: "This PR was marked as stale after ${{ env.DAYS_BEFORE_PR_STALE }} days of inactivity and will be closed after another ${{ env.DAYS_BEFORE_PR_CLOSE }} days of further inactivity. If this PR should be kept open, just add a comment, remove the stale label or push new commits to it."
3031
close-pr-message: "This PR was closed automatically because it has been stalled for ${{ env.DAYS_BEFORE_PR_CLOSE }} days with no activity. Feel free to re-open it at any time."
3132
days-before-pr-stale: ${{ env.DAYS_BEFORE_PR_STALE }}
3233
days-before-pr-close: ${{ env.DAYS_BEFORE_PR_CLOSE }}
34+
exempt-pr-labels: ${{ env.EXEMPT_PR_LABELS }}
3335
# never mark issues as stale or close them
3436
days-before-issue-stale: -1
3537
days-before-issue-close: -1

.github/workflows/tf-acc-test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- name: Checkout
15-
uses: actions/checkout@v4
15+
uses: actions/checkout@v6
1616
- name: Install project tools and dependencies
1717
run: make project-tools
1818
- name: Run tests

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Check one of the examples in the [examples](examples/) folder.
3434

3535
## Authentication
3636

37-
To authenticate, you will need a [service account](https://docs.stackit.cloud/stackit/en/service-accounts-134415819.html). Create it in the [STACKIT Portal](https://portal.stackit.cloud/) and assign the necessary permissions to it, e.g. `project.owner`. There are multiple ways to authenticate:
37+
To authenticate, you will need a [service account](https://docs.stackit.cloud/platform/access-and-identity/service-accounts/). Create it in the [STACKIT Portal](https://portal.stackit.cloud/) and assign the necessary permissions to it, e.g. `project.owner`. There are multiple ways to authenticate:
3838

3939
- Key flow (recommended)
4040
- Token flow (is scheduled for deprecation and will be removed on December 17, 2025.)
@@ -64,13 +64,13 @@ To use the key flow, you need to have a service account key, which must have an
6464

6565
When creating the service account key, a new pair can be created automatically, which will be included in the service account key. This will make it much easier to configure the key flow authentication in the [STACKIT Terraform Provider](https://github.com/stackitcloud/terraform-provider-stackit), by just providing the service account key.
6666

67-
**Optionally**, you can provide your own private key when creating the service account key, which will then require you to also provide it explicitly to the [STACKIT Terraform Provider](https://github.com/stackitcloud/terraform-provider-stackit), additionally to the service account key. Check the STACKIT Knowledge Base for an [example of how to create your own key-pair](https://docs.stackit.cloud/stackit/en/usage-of-the-service-account-keys-in-stackit-175112464.html#UsageoftheserviceaccountkeysinSTACKIT-CreatinganRSAkey-pair).
67+
**Optionally**, you can provide your own private key when creating the service account key, which will then require you to also provide it explicitly to the [STACKIT Terraform Provider](https://github.com/stackitcloud/terraform-provider-stackit), additionally to the service account key. Check the STACKIT Docs for an [example of how to create your own key-pair](https://docs.stackit.cloud/platform/access-and-identity/service-accounts/how-tos/manage-service-account-keys/).
6868

6969
To configure the key flow, follow this steps:
7070

7171
1. Create a service account key:
7272

73-
- Use the [STACKIT Portal](https://portal.stackit.cloud/): go to the `Service Accounts` tab, choose a `Service Account` and go to `Service Account Keys` to create a key. For more details, see [Create a service account key](https://docs.stackit.cloud/stackit/en/create-a-service-account-key-175112456.html)
73+
- Use the [STACKIT Portal](https://portal.stackit.cloud/): go to the `Service Accounts` tab, choose a `Service Account` and go to `Service Account Keys` to create a key. For more details, see [Create a service account key](https://docs.stackit.cloud/platform/access-and-identity/service-accounts/how-tos/manage-service-account-keys/)
7474

7575
2. Save the content of the service account key by copying it and saving it in a JSON file.
7676

@@ -122,9 +122,9 @@ Using this flow is less secure since the token is long-lived. You can provide th
122122

123123
## Backend configuration
124124

125-
To keep track of your Terraform state, you can configure an [S3 backend](https://developer.hashicorp.com/terraform/language/settings/backends/s3) using [STACKIT Object Storage](https://docs.stackit.cloud/stackit/en/object-storage-s3-compatible-71009778.html).
125+
To keep track of your terraform state, you can configure an [S3 backend](https://developer.hashicorp.com/terraform/language/settings/backends/s3) using [STACKIT Object Storage](https://docs.stackit.cloud/products/storage/object-storage).
126126

127-
To do so, you need an Object Storage [S3 bucket](https://docs.stackit.cloud/stackit/en/basic-concept-objectstorage-71009785.html#BasicConceptObjectStorage-Buckets) and [credentials](https://docs.stackit.cloud/stackit/en/basic-concept-objectstorage-71009785.html#BasicConceptObjectStorage-Credentials) to access it. If you need to create them, check [Getting Started - Object Storage](https://docs.stackit.cloud/stackit/en/getting-started-objectstorage-71009792.html).
127+
To do so, you need an Object Storage [S3 bucket](https://docs.stackit.cloud/products/storage/object-storage/basics/concepts/#buckets) and [credentials](https://docs.stackit.cloud/products/storage/object-storage/basics/concepts/#credentials) to access it. If you need to create them, check [Create and delete Object Storage buckets](https://docs.stackit.cloud/products/storage/object-storage/how-tos/create-and-manage-object-storage-buckets/) and [Create and delete Object Storage credentials](https://docs.stackit.cloud/products/storage/object-storage/how-tos/create-and-delete-object-storage-credentials/).
128128

129129
Once you have everything setup, you can configure the backend by adding the following block to your Terraform configuration:
130130

@@ -298,6 +298,6 @@ Apache 2.0
298298

299299
- [STACKIT](https://www.stackit.de/en/)
300300

301-
- [STACKIT Knowledge Base](https://docs.stackit.cloud/stackit/en/knowledge-base-85301704.html)
301+
- [STACKIT Docs](https://docs.stackit.cloud/)
302302

303303
- [STACKIT CLI](https://github.com/stackitcloud/stackit-cli/tree/main)

docs/data-sources/affinity_group.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,13 @@ data "stackit_affinity_group" "example" {
2727
- `affinity_group_id` (String) The affinity group ID.
2828
- `project_id` (String) STACKIT Project ID to which the affinity group is associated.
2929

30+
### Optional
31+
32+
- `region` (String) The resource region. If not defined, the provider region is used.
33+
3034
### Read-Only
3135

32-
- `id` (String) Terraform's internal resource identifier. It is structured as "`project_id`,`affinity_group_id`".
36+
- `id` (String) Terraform's internal resource identifier. It is structured as "`project_id`,`region`,`affinity_group_id`".
3337
- `members` (List of String) Affinity Group schema. Must have a `region` specified in the provider configuration.
3438
- `name` (String) The name of the affinity group.
3539
- `policy` (String) The policy of the affinity group.

0 commit comments

Comments
 (0)