-
You need to have a Pulumi account
-
Install Pulumi
-
Install pulumictl
-
Create the sdks via
make generate_sdks -
Run
make install_nodejs_sdk -
Ensure that the
pulumi-resource-stackitprovider is in your GOPATH (located under pulumi-stackit/bin) -
Use an existing example under e.g. the resources folder and adjust the example e.g. modify the project id.
-
Ensure that the local
@stackitcloud/pulumi-stackitmodule is installed. a. If you see errors mentioning that the module is not present install it vianpm install @stackitcloud/pulumi-stackit <path-to:sdk/nodejs/bin> -
Ensure you have set up the authentication accordingly (see Authentication) a. If you are using the
credentials.jsonmethod you don't need to do further steps, you are all set up. b. Otherwise you have to use one of the other methods: Set the key viapulumi configcommand or via environment variable or provide it via the provider options like this:const providerArgs: stackit.ProviderArgs = { serviceAccountKeyPath: "/path/to/your/sa_key.json", authorizationCustomEndpoint: "https://my-custom-endpoint.stackit.cloud" }; const provider = new stackit.Provider("stackit-provider", providerArgs); // Then you can use it like the following: export const example = stackit.getAffinityGroupOutput( { projectId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your actual project ID affinityGroupId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your actual affinity group ID }, { provider: provider, } );
-
Ensure that if you are using beta or experimental resources that those are enabled (see README)
-
Run the example via
pulumi up -
Remove the created resources with
pulumi down