Skip to content

Commit e478a82

Browse files
committed
fixup
Signed-off-by: Alexander Dahmen <alexander.dahmen@inovex.de>
1 parent eb5e19d commit e478a82

8 files changed

Lines changed: 37 additions & 36 deletions

File tree

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ To authenticate, you will need a [service account](https://docs.stackit.cloud/st
7171

7272
When setting up authentication, the provider will always try to use the key flow first and search for credentials in several locations, following a specific order:
7373

74-
1. Explicit configuration, e.g. by setting the field `service_account_key_path` in the provider block (see example below)
74+
1. Explicit configuration, e.g. by setting the field `serviceAccountKeyPath` in the provider block
7575
2. Environment variable, e.g. by setting `STACKIT_SERVICE_ACCOUNT_KEY_PATH` or `STACKIT_SERVICE_ACCOUNT_KEY`
7676
3. Credentials file
7777

@@ -127,15 +127,15 @@ To configure the key flow, follow this steps:
127127

128128
3. Configure the service account key for authentication in the provider by following one of the alternatives below:
129129

130-
- setting the fields in the provider block: `service_account_key` or `service_account_key_path`
130+
- setting the fields in the provider block: `serviceAccountKey` or `serviceAccountKeyPath`
131131
- setting the environment variable: `STACKIT_SERVICE_ACCOUNT_KEY_PATH` or `STACKIT_SERVICE_ACCOUNT_KEY`
132132
- ensure the set the service account key in `STACKIT_SERVICE_ACCOUNT_KEY` is correctly formatted. Use e.g.
133133
`$ export STACKIT_SERVICE_ACCOUNT_KEY=$(cat ./service-account-key.json)`
134134
- setting `STACKIT_SERVICE_ACCOUNT_KEY_PATH` in the credentials file (see above)
135135

136136
> **Optionally, only if you have provided your own RSA key-pair when creating the service account key**, you also need to configure your private key (takes precedence over the one included in the service account key, if present). **The private key must be PEM encoded** and can be provided using one of the options below:
137137
>
138-
> - setting the field in the provider block: `private_key` or `private_key_path`
138+
> - setting the field in the provider block: `privateKey` or `privateKeyPath`
139139
> - setting the environment variable: `STACKIT_PRIVATE_KEY_PATH` or `STACKIT_PRIVATE_KEY`
140140
> - setting `STACKIT_PRIVATE_KEY_PATH` in the credentials file (see above)
141141
@@ -146,7 +146,7 @@ To use beta resources in the STACKIT Pulumi provider, follow these steps:
146146

147147
1. **Provider Configuration Option**
148148

149-
Set the `enable_beta_resources` option in the provider configuration. This is a boolean attribute that can be either `true` or `false`. This can be done either in code directly or via the `pulumi config` command which writes this to a Pulumi.yaml file (e.g. `pulumi config set stackit:experiments [\"routing-tables\"]`).
149+
Set the `enableBetaResources` option in the provider configuration. This is a boolean attribute that can be either `true` or `false`. This can be done either in code directly or via the `pulumi config` command which writes this to a Pulumi.yaml file (e.g. `pulumi config set stackit:experiments [\"routing-tables\"]`).
150150

151151
The examples folder provides the information how this can be done in code.
152152

@@ -158,7 +158,7 @@ To use beta resources in the STACKIT Pulumi provider, follow these steps:
158158
export STACKIT_TF_ENABLE_BETA_RESOURCES=true
159159
```
160160

161-
> **Note**: The environment variable takes precedence over the provider configuration option. This means that if the `STACKIT_TF_ENABLE_BETA_RESOURCES` environment variable is set to a valid value (`"true"` or `"false"`), it will override the `enable_beta_resources` option specified in the provider configuration.
161+
> **Note**: The environment variable takes precedence over the provider configuration option. This means that if the `STACKIT_TF_ENABLE_BETA_RESOURCES` environment variable is set to a valid value (`"true"` or `"false"`), it will override the `enableBetaResources` option specified in the provider configuration.
162162
163163

164164
## Opting into Experiments

examples/ts/README.md

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,26 @@
1515
a. If you are using the `credentials.json` method you don't need to do further steps, you are all set up.
1616
b. Otherwise you have to use one of the other methods:
1717
Set the key via `pulumi config` command or via environment variable or provide it via the provider options like this:
18+
19+
```js
20+
const providerArgs: stackit.ProviderArgs = {
21+
serviceAccountKeyPath: "/path/to/your/sa_key.json",
22+
authorizationCustomEndpoint: "https://my-custom-endpoint.stackit.cloud"
23+
};
24+
const provider = new stackit.Provider("stackit-provider", providerArgs);
25+
26+
// Then you can use it like the following:
27+
export const example = stackit.getAffinityGroupOutput(
28+
{
29+
projectId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your actual project ID
30+
affinityGroupId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your actual affinity group ID
31+
},
32+
{
33+
provider: provider,
34+
}
35+
);
1836
```
19-
const providerArgs: stackit.ProviderArgs = {
20-
serviceAccountKeyPath: "/path/to/your/sa_key.json",
21-
authorizationCustomEndpoint: "https://my-custom-endpoint.stackit.cloud"
22-
};
23-
const provider = new stackit.Provider("stackit-provider", providerArgs);
24-
```
25-
You can then use it like the following:
26-
```
27-
export const example = stackit.getAffinityGroupOutput(
28-
{
29-
projectId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your actual project ID
30-
affinityGroupId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your actual affinity group ID
31-
},
32-
{
33-
provider: provider,
34-
}
35-
);
36-
```
37+
3738
11. Ensure that if you are using beta or experimental resources that those are enabled (see [README](../../README.md#opting-into-beta-resources))
3839
12. Run the example via `pulumi up`
3940
13. Remove the created resources with `pulumi down`

examples/ts/data-sources/iaas/image_v2/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
import * as pulumi from "@pulumi/pulumi";
22
import * as stackit from "@stackitcloud/pulumi-stackit";
33

4-
const _default = stackit.getImageV2Output({
4+
export const _default = stackit.getImageV2Output({
55
projectId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your actual project ID
66
imageId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your actual image ID
77
});
8-
const nameMatch = stackit.getImageV2Output({
8+
export const nameMatch = stackit.getImageV2Output({
99
projectId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your actual project ID
1010
name: "Ubuntu 22.04",
1111
});
12-
const nameRegexLatest = stackit.getImageV2Output({
12+
export const nameRegexLatest = stackit.getImageV2Output({
1313
projectId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your actual project ID
1414
nameRegex: "^Ubuntu .*",
1515
});
16-
const nameRegexOldest = stackit.getImageV2Output({
16+
export const nameRegexOldest = stackit.getImageV2Output({
1717
projectId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your actual project ID
1818
nameRegex: "^Ubuntu .*",
1919
sortAscending: true,
2020
});
21-
const filterDistroVersion = stackit.getImageV2Output({
21+
export const filterDistroVersion = stackit.getImageV2Output({
2222
projectId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your actual project ID
2323
filter: {
2424
distro: "debian",
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
import * as pulumi from "@pulumi/pulumi";
22
import * as stackit from "@stackitcloud/pulumi-stackit";
33

4-
const twoVcpusFilter = stackit.getMachineTypeOutput({
4+
export const twoVcpusFilter = stackit.getMachineTypeOutput({
55
projectId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your actual project ID
66
filter: "vcpus==2",
77
});
8-
const filterSortedAscendingFalse = stackit.getMachineTypeOutput({
8+
export const filterSortedAscendingFalse = stackit.getMachineTypeOutput({
99
projectId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your actual project ID
1010
filter: "vcpus >= 2 && ram >= 2048",
1111
sortAscending: false,
1212
});
13-
const intelIcelakeGenericFilter = stackit.getMachineTypeOutput({
13+
export const intelIcelakeGenericFilter = stackit.getMachineTypeOutput({
1414
projectId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your actual project ID
1515
filter: "extraSpecs.cpu==\"intel-icelake-generic\" && vcpus == 2",
1616
});
1717
// returns warning
18-
const noMatch = stackit.getMachineTypeOutput({
18+
export const noMatch = stackit.getMachineTypeOutput({
1919
projectId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your actual project ID
2020
filter: "vcpus == 99",
2121
});
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as pulumi from "@pulumi/pulumi";
22
import * as stackit from "@stackitcloud/pulumi-stackit";
33

4-
const example = stackit.getIaasProjectOutput({
4+
export const example = stackit.getIaasProjectOutput({
55
projectId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your actual project ID
66
});

examples/ts/data-sources/iaas/public_ip_ranges/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as pulumi from "@pulumi/pulumi";
22
import * as stackit from "@stackitcloud/pulumi-stackit";
33
import * as std from "@pulumi/std";
44

5-
const example = stackit.getPublicIpRangesOutput({});
5+
export const example = stackit.getPublicIpRangesOutput({});
66
// example usage: allow stackit services and customer vpn cidr to access observability apis
77
const vpnCidrs = [
88
"X.X.X.X/32", // Replace with your actual addresses

examples/ts/data-sources/iaas/routing_table_routes/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as pulumi from "@pulumi/pulumi";
22
import * as stackit from "@stackitcloud/pulumi-stackit";
33

4-
const example = stackit.getRoutingTableRoutesOutput({
4+
export const example = stackit.getRoutingTableRoutesOutput({
55
organizationId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your actual organization ID
66
networkAreaId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your actual network area ID
77
routingTableId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your actual routing table ID
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as pulumi from "@pulumi/pulumi";
22
import * as stackit from "@stackitcloud/pulumi-stackit";
33

4-
const example = stackit.getRoutingTablesOutput({
4+
export const example = stackit.getRoutingTablesOutput({
55
organizationId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your actual organization ID
66
networkAreaId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your actual network area ID
77
});

0 commit comments

Comments
 (0)