diff --git a/.ci-mgmt.yaml b/.ci-mgmt.yaml index 7880bece42..73f46058f3 100644 --- a/.ci-mgmt.yaml +++ b/.ci-mgmt.yaml @@ -4,8 +4,15 @@ makeTemplate: bridged # TODO: Enable this once our random provider is updated with framework support # generate-nightly-test-workflow: true plugins: + - name: std + version: "1.6.2" + + - name: terraform + version: "1.0.16" + kind: converter + - name: aws - version: "5.21.1" + version: "6.32.0" - name: azure version: "5.24.0" team: ecosystem @@ -21,3 +28,4 @@ actions: - name: Run provider tests run: | cd provider && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt +pulumiConvert: 1 diff --git a/.github/workflows/check-upstream-upgrade.yml b/.github/workflows/check-upstream-upgrade.yml index fc483816a8..352bc4d9a6 100644 --- a/.github/workflows/check-upstream-upgrade.yml +++ b/.github/workflows/check-upstream-upgrade.yml @@ -16,9 +16,6 @@ jobs: go-version: 1.21.x - name: Checkout Repo uses: actions/checkout@v4 - - name: Unshallow clone for tags - run: git fetch --prune --unshallow --tags - shell: bash - name: Install upgrade-provider run: go install github.com/pulumi/upgrade-provider@main shell: bash diff --git a/.github/workflows/license.yml b/.github/workflows/license.yml index 83d56ccdf3..2384bab689 100644 --- a/.github/workflows/license.yml +++ b/.github/workflows/license.yml @@ -44,8 +44,6 @@ jobs: uses: actions/checkout@v4 with: ref: ${{ env.PR_COMMIT_SHA }} - - name: Unshallow clone for tags - run: git fetch --prune --unshallow --tags - name: Install Go uses: actions/setup-go@v5 with: diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index e9c0d319d6..9e3c964e97 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -36,14 +36,9 @@ jobs: steps: - name: Checkout Repo uses: actions/checkout@v4 - - name: Checkout Scripts Repo - uses: actions/checkout@v4 + - uses: pulumi/provider-version-action@v1 with: - path: ci-scripts - repository: pulumi/scripts - ref: deca2c5c6015ad7aaea6f572a1c2b198ca323592 - - name: Unshallow clone for tags - run: git fetch --prune --unshallow --tags + set-env: 'PROVIDER_VERSION' - name: Install Go uses: actions/setup-go@v5 with: @@ -103,13 +98,10 @@ jobs: run: make install_plugins - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - - name: Set PACKAGE_VERSION to Env - run: echo "PACKAGE_VERSION=$(pulumictl get version --language generic)" >> - "$GITHUB_ENV" - name: Build SDK run: make build_${{ matrix.language }} - name: Check worktree clean - run: ./ci-scripts/ci/check-worktree-is-clean + uses: pulumi/git-status-check-action@v1 - name: Compress SDK folder run: tar -zcf sdk/${{ matrix.language }}.tar.gz -C sdk/${{ matrix.language }} . - name: Upload artifacts @@ -156,14 +148,6 @@ jobs: aws-access-key-id: ${{ secrets.AWS_CORP_S3_UPLOAD_ACCESS_KEY_ID }} aws-region: us-west-2 aws-secret-access-key: ${{ secrets.AWS_CORP_S3_UPLOAD_SECRET_ACCESS_KEY }} - - name: Checkout Scripts Repo - uses: actions/checkout@v4 - with: - path: ci-scripts - repository: pulumi/scripts - ref: deca2c5c6015ad7aaea6f572a1c2b198ca323592 - - name: Unshallow clone for tags - run: git fetch --prune --unshallow --tags - name: Install Go uses: actions/setup-go@v5 with: @@ -211,20 +195,15 @@ jobs: steps: - name: Checkout Repo uses: actions/checkout@v4 + - uses: pulumi/provider-version-action@v1 + with: + set-env: 'PROVIDER_VERSION' - name: Cache examples generation uses: actions/cache@v4 with: path: | .pulumi/examples-cache key: ${{ runner.os }}-${{ hashFiles('provider/go.sum') }} - - name: Checkout Scripts Repo - uses: actions/checkout@v4 - with: - path: ci-scripts - repository: pulumi/scripts - ref: deca2c5c6015ad7aaea6f572a1c2b198ca323592 - - name: Unshallow clone for tags - run: git fetch --prune --unshallow --tags - name: Prepare upstream code run: make upstream - name: Install Go @@ -341,8 +320,6 @@ jobs: swap-storage: false - name: Checkout Repo uses: actions/checkout@v4 - - name: Unshallow clone for tags - run: git fetch --prune --unshallow --tags - name: Install Go uses: actions/setup-go@v5 with: @@ -368,10 +345,12 @@ jobs: role-external-id: upload-pulumi-release role-session-name: ${{ env.PROVIDER }}@githubActions role-to-assume: ${{ secrets.AWS_UPLOAD_ROLE_ARN }} - - name: Set PreRelease Version - run: echo "GORELEASER_CURRENT_TAG=v$(pulumictl get version --language generic)" >> "$GITHUB_ENV" + - id: version + uses: pulumi/provider-version-action@v1 - name: Run GoReleaser uses: goreleaser/goreleaser-action@v5 + env: + GORELEASER_CURRENT_TAG: v${{ steps.version.outputs.version }} with: args: -p 3 -f .goreleaser.prerelease.yml --rm-dist --skip-validate --timeout 60m0s @@ -388,10 +367,13 @@ jobs: needs: publish runs-on: ubuntu-latest steps: + - id: version + uses: pulumi/provider-version-action@v1 - name: Publish SDKs - uses: pulumi/pulumi-package-publisher@v0.0.14 + uses: pulumi/pulumi-package-publisher@v0.0.15 with: sdk: all + version: ${{ steps.version.outputs.version }} - env: SLACK_CHANNEL: provider-upgrade-publish-status SLACK_COLOR: "#FF0000" @@ -431,14 +413,9 @@ jobs: steps: - name: Checkout Repo uses: actions/checkout@v4 - - name: Checkout Scripts Repo - uses: actions/checkout@v4 + - uses: pulumi/provider-version-action@v1 with: - path: ci-scripts - repository: pulumi/scripts - ref: deca2c5c6015ad7aaea6f572a1c2b198ca323592 - - name: Unshallow clone for tags - run: git fetch --prune --unshallow --tags + set-env: 'PROVIDER_VERSION' - name: Install Go uses: actions/setup-go@v5 with: diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index 05793a712c..4755e9430c 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -37,14 +37,9 @@ jobs: steps: - name: Checkout Repo uses: actions/checkout@v4 - - name: Checkout Scripts Repo - uses: actions/checkout@v4 + - uses: pulumi/provider-version-action@v1 with: - path: ci-scripts - repository: pulumi/scripts - ref: deca2c5c6015ad7aaea6f572a1c2b198ca323592 - - name: Unshallow clone for tags - run: git fetch --prune --unshallow --tags + set-env: 'PROVIDER_VERSION' - name: Install Go uses: actions/setup-go@v5 with: @@ -104,13 +99,10 @@ jobs: run: make install_plugins - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - - name: Set PACKAGE_VERSION to Env - run: echo "PACKAGE_VERSION=$(pulumictl get version --language generic)" >> - "$GITHUB_ENV" - name: Build SDK run: make build_${{ matrix.language }} - name: Check worktree clean - run: ./ci-scripts/ci/check-worktree-is-clean + uses: pulumi/git-status-check-action@v1 - name: Compress SDK folder run: tar -zcf sdk/${{ matrix.language }}.tar.gz -C sdk/${{ matrix.language }} . - name: Upload artifacts @@ -150,20 +142,15 @@ jobs: steps: - name: Checkout Repo uses: actions/checkout@v4 + - uses: pulumi/provider-version-action@v1 + with: + set-env: 'PROVIDER_VERSION' - name: Cache examples generation uses: actions/cache@v4 with: path: | .pulumi/examples-cache key: ${{ runner.os }}-${{ hashFiles('provider/go.sum') }} - - name: Checkout Scripts Repo - uses: actions/checkout@v4 - with: - path: ci-scripts - repository: pulumi/scripts - ref: deca2c5c6015ad7aaea6f572a1c2b198ca323592 - - name: Unshallow clone for tags - run: git fetch --prune --unshallow --tags - name: Prepare upstream code run: make upstream - name: Install Go @@ -280,8 +267,6 @@ jobs: swap-storage: false - name: Checkout Repo uses: actions/checkout@v4 - - name: Unshallow clone for tags - run: git fetch --prune --unshallow --tags - name: Install Go uses: actions/setup-go@v5 with: @@ -307,10 +292,12 @@ jobs: role-external-id: upload-pulumi-release role-session-name: ${{ env.PROVIDER }}@githubActions role-to-assume: ${{ secrets.AWS_UPLOAD_ROLE_ARN }} - - name: Set PreRelease Version - run: echo "GORELEASER_CURRENT_TAG=v$(pulumictl get version --language generic)" >> "$GITHUB_ENV" + - id: version + uses: pulumi/provider-version-action@v1 - name: Run GoReleaser uses: goreleaser/goreleaser-action@v5 + env: + GORELEASER_CURRENT_TAG: v${{ steps.version.outputs.version }} with: args: -p 3 -f .goreleaser.prerelease.yml --rm-dist --skip-validate --timeout 60m0s @@ -327,10 +314,13 @@ jobs: needs: publish runs-on: ubuntu-latest steps: + - id: version + uses: pulumi/provider-version-action@v1 - name: Publish SDKs - uses: pulumi/pulumi-package-publisher@v0.0.14 + uses: pulumi/pulumi-package-publisher@v0.0.15 with: sdk: all + version: ${{ steps.version.outputs.version }} - env: SLACK_CHANNEL: provider-upgrade-publish-status SLACK_COLOR: "#FF0000" @@ -352,14 +342,9 @@ jobs: steps: - name: Checkout Repo uses: actions/checkout@v4 - - name: Checkout Scripts Repo - uses: actions/checkout@v4 + - uses: pulumi/provider-version-action@v1 with: - path: ci-scripts - repository: pulumi/scripts - ref: deca2c5c6015ad7aaea6f572a1c2b198ca323592 - - name: Unshallow clone for tags - run: git fetch --prune --unshallow --tags + set-env: 'PROVIDER_VERSION' - name: Install Go uses: actions/setup-go@v5 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d260517ffe..190eb21a9c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -36,14 +36,9 @@ jobs: steps: - name: Checkout Repo uses: actions/checkout@v4 - - name: Checkout Scripts Repo - uses: actions/checkout@v4 + - uses: pulumi/provider-version-action@v1 with: - path: ci-scripts - repository: pulumi/scripts - ref: deca2c5c6015ad7aaea6f572a1c2b198ca323592 - - name: Unshallow clone for tags - run: git fetch --prune --unshallow --tags + set-env: 'PROVIDER_VERSION' - name: Install Go uses: actions/setup-go@v5 with: @@ -103,13 +98,10 @@ jobs: run: make install_plugins - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - - name: Set PACKAGE_VERSION to Env - run: echo "PACKAGE_VERSION=$(pulumictl get version --language generic)" >> - "$GITHUB_ENV" - name: Build SDK run: make build_${{ matrix.language }} - name: Check worktree clean - run: ./ci-scripts/ci/check-worktree-is-clean + uses: pulumi/git-status-check-action@v1 - name: Compress SDK folder run: tar -zcf sdk/${{ matrix.language }}.tar.gz -C sdk/${{ matrix.language }} . - name: Upload artifacts @@ -164,20 +156,15 @@ jobs: steps: - name: Checkout Repo uses: actions/checkout@v4 + - uses: pulumi/provider-version-action@v1 + with: + set-env: 'PROVIDER_VERSION' - name: Cache examples generation uses: actions/cache@v4 with: path: | .pulumi/examples-cache key: ${{ runner.os }}-${{ hashFiles('provider/go.sum') }} - - name: Checkout Scripts Repo - uses: actions/checkout@v4 - with: - path: ci-scripts - repository: pulumi/scripts - ref: deca2c5c6015ad7aaea6f572a1c2b198ca323592 - - name: Unshallow clone for tags - run: git fetch --prune --unshallow --tags - name: Prepare upstream code run: make upstream - name: Install Go @@ -294,8 +281,6 @@ jobs: swap-storage: false - name: Checkout Repo uses: actions/checkout@v4 - - name: Unshallow clone for tags - run: git fetch --prune --unshallow --tags - name: Install Go uses: actions/setup-go@v5 with: @@ -321,10 +306,12 @@ jobs: role-external-id: upload-pulumi-release role-session-name: ${{ env.PROVIDER }}@githubActions role-to-assume: ${{ secrets.AWS_UPLOAD_ROLE_ARN }} - - name: Set PreRelease Version - run: echo "GORELEASER_CURRENT_TAG=v$(pulumictl get version --language generic)" >> "$GITHUB_ENV" + - id: version + uses: pulumi/provider-version-action@v1 - name: Run GoReleaser uses: goreleaser/goreleaser-action@v5 + env: + GORELEASER_CURRENT_TAG: v${{ steps.version.outputs.version }} with: args: -p 3 release --rm-dist --timeout 60m0s version: latest @@ -340,10 +327,13 @@ jobs: needs: publish runs-on: ubuntu-latest steps: + - id: version + uses: pulumi/provider-version-action@v1 - name: Publish SDKs - uses: pulumi/pulumi-package-publisher@v0.0.14 + uses: pulumi/pulumi-package-publisher@v0.0.15 with: sdk: all + version: ${{ steps.version.outputs.version }} - env: SLACK_CHANNEL: provider-upgrade-publish-status SLACK_COLOR: "#FF0000" @@ -367,9 +357,11 @@ jobs: with: tag: v0.0.46 repo: pulumi/pulumictl + - id: version + uses: pulumi/provider-version-action@v1 - name: Add SDK version tag - run: git tag "sdk/v$(pulumictl get version --language generic)" && git push origin - "sdk/v$(pulumictl get version --language generic)" + run: git tag "sdk/v${{ steps.version.outputs.version }}" && git push origin + "sdk/v${{ steps.version.outputs.version }}" clean_up_release_labels: name: Clean up release labels @@ -379,8 +371,6 @@ jobs: steps: - name: Checkout Repo uses: actions/checkout@v4 - - name: Unshallow clone for PR merge bases - run: git fetch --prune --unshallow --tags - name: Clean up release labels uses: pulumi/action-release-by-pr-label@main with: @@ -400,14 +390,9 @@ jobs: steps: - name: Checkout Repo uses: actions/checkout@v4 - - name: Checkout Scripts Repo - uses: actions/checkout@v4 + - uses: pulumi/provider-version-action@v1 with: - path: ci-scripts - repository: pulumi/scripts - ref: deca2c5c6015ad7aaea6f572a1c2b198ca323592 - - name: Unshallow clone for tags - run: git fetch --prune --unshallow --tags + set-env: 'PROVIDER_VERSION' - name: Install Go uses: actions/setup-go@v5 with: diff --git a/.github/workflows/resync-build.yml b/.github/workflows/resync-build.yml index c5b198b289..94eccf7765 100644 --- a/.github/workflows/resync-build.yml +++ b/.github/workflows/resync-build.yml @@ -45,8 +45,6 @@ jobs: - id: run-url name: Create URL to the run output run: echo "run-url=https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" >> "$GITHUB_OUTPUT" - - name: Unshallow clone for tags - run: git fetch --prune --unshallow --tags - name: Install Go uses: actions/setup-go@v5 with: diff --git a/.github/workflows/run-acceptance-tests.yml b/.github/workflows/run-acceptance-tests.yml index fa65b818d2..c3d1e1e3e0 100644 --- a/.github/workflows/run-acceptance-tests.yml +++ b/.github/workflows/run-acceptance-tests.yml @@ -46,14 +46,9 @@ jobs: uses: actions/checkout@v4 with: ref: ${{ env.PR_COMMIT_SHA }} - - name: Checkout Scripts Repo - uses: actions/checkout@v4 + - uses: pulumi/provider-version-action@v1 with: - path: ci-scripts - repository: pulumi/scripts - ref: deca2c5c6015ad7aaea6f572a1c2b198ca323592 - - name: Unshallow clone for tags - run: git fetch --prune --unshallow --tags + set-env: 'PROVIDER_VERSION' - name: Install Go uses: actions/setup-go@v5 with: @@ -113,13 +108,10 @@ jobs: run: make install_plugins - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - - name: Set PACKAGE_VERSION to Env - run: echo "PACKAGE_VERSION=$(pulumictl get version --language generic)" >> - "$GITHUB_ENV" - name: Build SDK run: make build_${{ matrix.language }} - name: Check worktree clean - run: ./ci-scripts/ci/check-worktree-is-clean + uses: pulumi/git-status-check-action@v1 - name: Compress SDK folder run: tar -zcf sdk/${{ matrix.language }}.tar.gz -C sdk/${{ matrix.language }} . - name: Upload artifacts @@ -174,20 +166,15 @@ jobs: steps: - name: Checkout Repo uses: actions/checkout@v4 + - uses: pulumi/provider-version-action@v1 + with: + set-env: 'PROVIDER_VERSION' - name: Cache examples generation uses: actions/cache@v4 with: path: | .pulumi/examples-cache key: ${{ runner.os }}-${{ hashFiles('provider/go.sum') }} - - name: Checkout Scripts Repo - uses: actions/checkout@v4 - with: - path: ci-scripts - repository: pulumi/scripts - ref: deca2c5c6015ad7aaea6f572a1c2b198ca323592 - - name: Unshallow clone for tags - run: git fetch --prune --unshallow --tags - name: Prepare upstream code run: make upstream - name: Install Go @@ -342,20 +329,15 @@ jobs: uses: actions/checkout@v4 with: ref: ${{ env.PR_COMMIT_SHA }} - - name: Checkout Scripts Repo - uses: actions/checkout@v4 + - uses: pulumi/provider-version-action@v1 with: - path: ci-scripts - repository: pulumi/scripts - ref: deca2c5c6015ad7aaea6f572a1c2b198ca323592 + set-env: 'PROVIDER_VERSION' - name: Checkout p/examples if: matrix.testTarget == 'pulumiExamples' uses: actions/checkout@v4 with: repository: pulumi/examples path: p-examples - - name: Unshallow clone for tags - run: git fetch --prune --unshallow --tags - name: Install Go uses: actions/setup-go@v5 with: diff --git a/Makefile b/Makefile index fd4c8369c2..56b43e6246 100644 --- a/Makefile +++ b/Makefile @@ -7,11 +7,16 @@ PROVIDER_PATH := provider/v4 VERSION_PATH := $(PROVIDER_PATH)/pkg/version.Version TFGEN := pulumi-tfgen-$(PACK) PROVIDER := pulumi-resource-$(PACK) -VERSION := $(shell pulumictl get version) JAVA_GEN := pulumi-java-gen TESTPARALLELISM := 10 WORKING_DIR := $(shell pwd) -PULUMI_CONVERT := 0 +PULUMI_CONVERT := 1 + +# Override during CI using `make [TARGET] PROVIDER_VERSION=""` or by setting a PROVIDER_VERSION environment variable +# Local & branch builds will just used this fixed default version unless specified +PROVIDER_VERSION ?= 4.0.0-alpha.0+dev +# Use this normalised version everywhere rather than the raw input to ensure consistency. +VERSION_GENERIC = $(shell pulumictl convert-version --language generic --version "$(PROVIDER_VERSION)") development: install_plugins provider build_sdks install_sdks @@ -29,16 +34,15 @@ install_sdks: install_dotnet_sdk install_python_sdk install_nodejs_sdk install_j only_build: build -build_dotnet: DOTNET_VERSION := $(shell pulumictl get version --language dotnet) +build_dotnet: DOTNET_VERSION := $(shell pulumictl convert-version --language dotnet -v "$(VERSION_GENERIC)") build_dotnet: export PULUMI_HOME := $(WORKING_DIR)/.pulumi build_dotnet: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) build_dotnet: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache build_dotnet: upstream - pulumictl get version --language dotnet PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) $(WORKING_DIR)/bin/$(TFGEN) dotnet --out sdk/dotnet/ cd sdk/dotnet/ && \ printf "module fake_dotnet_module // Exclude this directory from Go tools\n\ngo 1.17\n" > go.mod && \ - echo "$(DOTNET_VERSION)" >version.txt && \ + echo "$(VERSION_GENERIC)" >version.txt && \ dotnet build /p:Version=$(DOTNET_VERSION) build_go: export PULUMI_HOME := $(WORKING_DIR)/.pulumi @@ -48,7 +52,7 @@ build_go: upstream PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) $(WORKING_DIR)/bin/$(TFGEN) go --out sdk/go/ cd sdk && go list "$$(grep -e "^module" go.mod | cut -d ' ' -f 2)/go/..." | xargs -I {} bash -c 'go build {} && go clean -i {}' -build_java: PACKAGE_VERSION := $(shell pulumictl get version --language generic) +build_java: PACKAGE_VERSION := $(VERSION_GENERIC) build_java: export PULUMI_HOME := $(WORKING_DIR)/.pulumi build_java: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) build_java: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache @@ -56,9 +60,10 @@ build_java: bin/pulumi-java-gen upstream $(WORKING_DIR)/bin/$(JAVA_GEN) generate --schema provider/cmd/$(PROVIDER)/schema.json --out sdk/java --build gradle-nexus cd sdk/java/ && \ printf "module fake_java_module // Exclude this directory from Go tools\n\ngo 1.17\n" > go.mod && \ - gradle --console=plain build + gradle --console=plain build && \ + gradle --console=plain javadoc -build_nodejs: VERSION := $(shell pulumictl get version --language javascript) +build_nodejs: NODE_VERSION := $(shell pulumictl convert-version --language javascript -v "$(VERSION_GENERIC)") build_nodejs: export PULUMI_HOME := $(WORKING_DIR)/.pulumi build_nodejs: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) build_nodejs: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache @@ -69,9 +74,9 @@ build_nodejs: upstream yarn install && \ yarn run tsc && \ cp ../../README.md ../../LICENSE* package.json yarn.lock ./bin/ && \ - sed -i.bak -e "s/\$${VERSION}/$(VERSION)/g" ./bin/package.json + sed -i.bak -e "s/\$${VERSION}/$(NODE_VERSION)/g" ./bin/package.json -build_python: PYPI_VERSION := $(shell pulumictl get version --language python) +build_python: PYPI_VERSION := $(shell pulumictl convert-version --language python -v "$(VERSION_GENERIC)") build_python: export PULUMI_HOME := $(WORKING_DIR)/.pulumi build_python: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) build_python: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache @@ -111,7 +116,9 @@ install_nodejs_sdk: install_plugins: export PULUMI_HOME := $(WORKING_DIR)/.pulumi install_plugins: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) install_plugins: .pulumi/bin/pulumi - .pulumi/bin/pulumi plugin install resource aws 5.21.1 + .pulumi/bin/pulumi plugin install resource std 1.6.2 + .pulumi/bin/pulumi plugin install converter terraform 1.0.16 + .pulumi/bin/pulumi plugin install resource aws 6.32.0 .pulumi/bin/pulumi plugin install resource azure 5.24.0 lint_provider: provider @@ -126,7 +133,7 @@ lint_provider.fix: # `cmd/pulumi-resource-random/schema.json` is valid and up to date. # To create a release ready binary, you should use `make provider`. provider_no_deps: - (cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(PROVIDER) -ldflags "-X $(PROJECT)/$(VERSION_PATH)=$(VERSION)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(PROVIDER)) + (cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(PROVIDER) -ldflags "-X $(PROJECT)/$(VERSION_PATH)=$(VERSION_GENERIC)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(PROVIDER)) provider: tfgen provider_no_deps @@ -149,10 +156,10 @@ tfgen_no_deps: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulum tfgen_no_deps: export PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION := $(PULUMI_CONVERT) tfgen_no_deps: tfgen_build_only $(WORKING_DIR)/bin/$(TFGEN) schema --out provider/cmd/$(PROVIDER) - (cd provider && VERSION=$(VERSION) go generate cmd/$(PROVIDER)/main.go) + (cd provider && VERSION=$(VERSION_GENERIC) go generate cmd/$(PROVIDER)/main.go) tfgen_build_only: - (cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(TFGEN) -ldflags "-X $(PROJECT)/$(VERSION_PATH)=$(VERSION)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(TFGEN)) + (cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(TFGEN) -ldflags "-X $(PROJECT)/$(VERSION_PATH)=$(VERSION_GENERIC)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(TFGEN)) upstream: ifneq ("$(wildcard upstream)","") diff --git a/provider/cmd/pulumi-resource-random/schema.json b/provider/cmd/pulumi-resource-random/schema.json index ec443444b0..5b45c49d4c 100644 --- a/provider/cmd/pulumi-resource-random/schema.json +++ b/provider/cmd/pulumi-resource-random/schema.json @@ -56,7 +56,7 @@ }, "resources": { "random:index/randomBytes:RandomBytes": { - "description": "The resource `random.RandomBytes` generates random bytes that are intended to be used as a secret, or key. Use this in preference to `random.RandomId` when the output is considered sensitive, and should not be displayed in the CLI.\n\nThis resource *does* use a cryptographic random number generator.\n\n## Example Usage\n\n\u003c!--Start PulumiCodeChooser --\u003e\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as azure from \"@pulumi/azure\";\nimport * as random from \"@pulumi/random\";\n\nconst jwtSecretRandomBytes = new random.RandomBytes(\"jwtSecretRandomBytes\", {length: 64});\nconst jwtSecretSecret = new azure.keyvault.Secret(\"jwtSecretSecret\", {\n keyVaultId: \"some-azure-key-vault-id\",\n value: jwtSecretRandomBytes.base64,\n});\n```\n```python\nimport pulumi\nimport pulumi_azure as azure\nimport pulumi_random as random\n\njwt_secret_random_bytes = random.RandomBytes(\"jwtSecretRandomBytes\", length=64)\njwt_secret_secret = azure.keyvault.Secret(\"jwtSecretSecret\",\n key_vault_id=\"some-azure-key-vault-id\",\n value=jwt_secret_random_bytes.base64)\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Azure = Pulumi.Azure;\nusing Random = Pulumi.Random;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var jwtSecretRandomBytes = new Random.RandomBytes(\"jwtSecretRandomBytes\", new()\n {\n Length = 64,\n });\n\n var jwtSecretSecret = new Azure.KeyVault.Secret(\"jwtSecretSecret\", new()\n {\n KeyVaultId = \"some-azure-key-vault-id\",\n Value = jwtSecretRandomBytes.Base64,\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault\"\n\t\"github.com/pulumi/pulumi-random/sdk/v4/go/random\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\tjwtSecretRandomBytes, err := random.NewRandomBytes(ctx, \"jwtSecretRandomBytes\", \u0026random.RandomBytesArgs{\n\t\t\tLength: pulumi.Int(64),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = keyvault.NewSecret(ctx, \"jwtSecretSecret\", \u0026keyvault.SecretArgs{\n\t\t\tKeyVaultId: pulumi.String(\"some-azure-key-vault-id\"),\n\t\t\tValue: jwtSecretRandomBytes.Base64,\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.random.RandomBytes;\nimport com.pulumi.random.RandomBytesArgs;\nimport com.pulumi.azure.keyvault.Secret;\nimport com.pulumi.azure.keyvault.SecretArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n var jwtSecretRandomBytes = new RandomBytes(\"jwtSecretRandomBytes\", RandomBytesArgs.builder() \n .length(64)\n .build());\n\n var jwtSecretSecret = new Secret(\"jwtSecretSecret\", SecretArgs.builder() \n .keyVaultId(\"some-azure-key-vault-id\")\n .value(jwtSecretRandomBytes.base64())\n .build());\n\n }\n}\n```\n```yaml\nresources:\n jwtSecretRandomBytes:\n type: random:RandomBytes\n properties:\n length: 64\n jwtSecretSecret:\n type: azure:keyvault:Secret\n properties:\n keyVaultId: some-azure-key-vault-id\n value: ${jwtSecretRandomBytes.base64}\n```\n\u003c!--End PulumiCodeChooser --\u003e\n\n## Import\n\nRandom bytes can be imported by specifying the value as base64 string.\n\n```sh\n$ pulumi import random:index/randomBytes:RandomBytes basic \"8/fu3q+2DcgSJ19i0jZ5Cw==\"\n```\n\n", + "description": "The resource `random.RandomBytes` generates random bytes that are intended to be used as a secret, or key. Use this in preference to `random.RandomId` when the output is considered sensitive, and should not be displayed in the CLI.\n\nThis resource *does* use a cryptographic random number generator.\n\n## Example Usage\n\n\u003c!--Start PulumiCodeChooser --\u003e\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as azurerm from \"@pulumi/azurerm\";\nimport * as random from \"@pulumi/random\";\n\nconst jwtSecret = new random.RandomBytes(\"jwt_secret\", {length: 64});\nconst jwtSecretKeyVaultSecret = new azurerm.index.KeyVaultSecret(\"jwt_secret\", {\n keyVaultId: \"some-azure-key-vault-id\",\n name: \"JwtSecret\",\n value: jwtSecret.base64,\n});\n```\n```python\nimport pulumi\nimport pulumi_azurerm as azurerm\nimport pulumi_random as random\n\njwt_secret = random.RandomBytes(\"jwt_secret\", length=64)\njwt_secret_key_vault_secret = azurerm.index.KeyVaultSecret(\"jwt_secret\",\n key_vault_id=some-azure-key-vault-id,\n name=JwtSecret,\n value=jwt_secret.base64)\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Azurerm = Pulumi.Azurerm;\nusing Random = Pulumi.Random;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var jwtSecret = new Random.RandomBytes(\"jwt_secret\", new()\n {\n Length = 64,\n });\n\n var jwtSecretKeyVaultSecret = new Azurerm.Index.KeyVaultSecret(\"jwt_secret\", new()\n {\n KeyVaultId = \"some-azure-key-vault-id\",\n Name = \"JwtSecret\",\n Value = jwtSecret.Base64,\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-azurerm/sdk/v1/go/azurerm\"\n\t\"github.com/pulumi/pulumi-random/sdk/v4/go/random\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\tjwtSecret, err := random.NewRandomBytes(ctx, \"jwt_secret\", \u0026random.RandomBytesArgs{\n\t\t\tLength: pulumi.Int(64),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = index.NewKeyVaultSecret(ctx, \"jwt_secret\", \u0026index.KeyVaultSecretArgs{\n\t\t\tKeyVaultId: \"some-azure-key-vault-id\",\n\t\t\tName: \"JwtSecret\",\n\t\t\tValue: jwtSecret.Base64,\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.random.RandomBytes;\nimport com.pulumi.random.RandomBytesArgs;\nimport com.pulumi.azurerm.keyVaultSecret;\nimport com.pulumi.azurerm.KeyVaultSecretArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n var jwtSecret = new RandomBytes(\"jwtSecret\", RandomBytesArgs.builder() \n .length(64)\n .build());\n\n var jwtSecretKeyVaultSecret = new KeyVaultSecret(\"jwtSecretKeyVaultSecret\", KeyVaultSecretArgs.builder() \n .keyVaultId(\"some-azure-key-vault-id\")\n .name(\"JwtSecret\")\n .value(jwtSecret.base64())\n .build());\n\n }\n}\n```\n```yaml\nresources:\n jwtSecret:\n type: random:RandomBytes\n name: jwt_secret\n properties:\n length: 64\n jwtSecretKeyVaultSecret:\n type: azurerm:keyVaultSecret\n name: jwt_secret\n properties:\n keyVaultId: some-azure-key-vault-id\n name: JwtSecret\n value: ${jwtSecret.base64}\n```\n\u003c!--End PulumiCodeChooser --\u003e\n\n## Import\n\nRandom bytes can be imported by specifying the value as base64 string.\n\n```sh\n$ pulumi import random:index/randomBytes:RandomBytes basic \"8/fu3q+2DcgSJ19i0jZ5Cw==\"\n```\n\n", "properties": { "base64": { "type": "string", @@ -130,7 +130,7 @@ } }, "random:index/randomId:RandomId": { - "description": "The resource `random.RandomId` generates random numbers that are intended to be\nused as unique identifiers for other resources. If the output is considered \nsensitive, and should not be displayed in the CLI, use `random.RandomBytes`\ninstead.\n\nThis resource *does* use a cryptographic random number generator in order\nto minimize the chance of collisions, making the results of this resource\nwhen a 16-byte identifier is requested of equivalent uniqueness to a\ntype-4 UUID.\n\nThis resource can be used in conjunction with resources that have\nthe `create_before_destroy` lifecycle flag set to avoid conflicts with\nunique names during the brief period where both the old and new resources\nexist concurrently.\n\n## Example Usage\n\n\u003c!--Start PulumiCodeChooser --\u003e\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as aws from \"@pulumi/aws\";\nimport * as random from \"@pulumi/random\";\n\n// The following example shows how to generate a unique name for an AWS EC2\n// instance that changes each time a new AMI id is selected.\nconst serverRandomId = new random.RandomId(\"serverRandomId\", {\n keepers: {\n ami_id: _var.ami_id,\n },\n byteLength: 8,\n});\nconst serverInstance = new aws.ec2.Instance(\"serverInstance\", {\n tags: {\n Name: pulumi.interpolate`web-server ${serverRandomId.hex}`,\n },\n ami: serverRandomId.keepers.apply(keepers =\u003e keepers?.amiId),\n});\n// ... (other aws_instance arguments) ...\n```\n```python\nimport pulumi\nimport pulumi_aws as aws\nimport pulumi_random as random\n\n# The following example shows how to generate a unique name for an AWS EC2\n# instance that changes each time a new AMI id is selected.\nserver_random_id = random.RandomId(\"serverRandomId\",\n keepers={\n \"ami_id\": var[\"ami_id\"],\n },\n byte_length=8)\nserver_instance = aws.ec2.Instance(\"serverInstance\",\n tags={\n \"Name\": server_random_id.hex.apply(lambda hex: f\"web-server {hex}\"),\n },\n ami=server_random_id.keepers[\"amiId\"])\n# ... (other aws_instance arguments) ...\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Aws = Pulumi.Aws;\nusing Random = Pulumi.Random;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n // The following example shows how to generate a unique name for an AWS EC2\n // instance that changes each time a new AMI id is selected.\n var serverRandomId = new Random.RandomId(\"serverRandomId\", new()\n {\n Keepers = \n {\n { \"ami_id\", @var.Ami_id },\n },\n ByteLength = 8,\n });\n\n var serverInstance = new Aws.Ec2.Instance(\"serverInstance\", new()\n {\n Tags = \n {\n { \"Name\", serverRandomId.Hex.Apply(hex =\u003e $\"web-server {hex}\") },\n },\n Ami = serverRandomId.Keepers.Apply(keepers =\u003e keepers?.AmiId),\n });\n\n // ... (other aws_instance arguments) ...\n});\n```\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/ec2\"\n\t\"github.com/pulumi/pulumi-random/sdk/v4/go/random\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t// The following example shows how to generate a unique name for an AWS EC2\n\t\t// instance that changes each time a new AMI id is selected.\n\t\tserverRandomId, err := random.NewRandomId(ctx, \"serverRandomId\", \u0026random.RandomIdArgs{\n\t\t\tKeepers: pulumi.StringMap{\n\t\t\t\t\"ami_id\": pulumi.Any(_var.Ami_id),\n\t\t\t},\n\t\t\tByteLength: pulumi.Int(8),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = ec2.NewInstance(ctx, \"serverInstance\", \u0026ec2.InstanceArgs{\n\t\t\tTags: pulumi.StringMap{\n\t\t\t\t\"Name\": serverRandomId.Hex.ApplyT(func(hex string) (string, error) {\n\t\t\t\t\treturn fmt.Sprintf(\"web-server %v\", hex), nil\n\t\t\t\t}).(pulumi.StringOutput),\n\t\t\t},\n\t\t\tAmi: serverRandomId.Keepers.ApplyT(func(keepers interface{}) (*string, error) {\n\t\t\t\treturn \u0026keepers.AmiId, nil\n\t\t\t}).(pulumi.StringPtrOutput),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.random.RandomId;\nimport com.pulumi.random.RandomIdArgs;\nimport com.pulumi.aws.ec2.Instance;\nimport com.pulumi.aws.ec2.InstanceArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n // The following example shows how to generate a unique name for an AWS EC2\n // instance that changes each time a new AMI id is selected.\n var serverRandomId = new RandomId(\"serverRandomId\", RandomIdArgs.builder() \n .keepers(Map.of(\"ami_id\", var_.ami_id()))\n .byteLength(8)\n .build());\n\n var serverInstance = new Instance(\"serverInstance\", InstanceArgs.builder() \n .tags(Map.of(\"Name\", serverRandomId.hex().applyValue(hex -\u003e String.format(\"web-server %s\", hex))))\n .ami(serverRandomId.keepers().applyValue(keepers -\u003e keepers.amiId()))\n .build());\n\n // ... (other aws_instance arguments) ...\n }\n}\n```\n```yaml\nresources:\n # The following example shows how to generate a unique name for an AWS EC2\n # instance that changes each time a new AMI id is selected.\n serverRandomId:\n type: random:RandomId\n properties:\n keepers:\n ami_id: ${var.ami_id}\n byteLength: 8\n serverInstance:\n type: aws:ec2:Instance\n properties:\n tags:\n Name: web-server ${serverRandomId.hex}\n # Read the AMI id \"through\" the random_id resource to ensure that\n # # both will change together.\n ami: ${serverRandomId.keepers.amiId}\n```\n\u003c!--End PulumiCodeChooser --\u003e\n\n## Import\n\nRandom IDs can be imported using the b64_url with an optional prefix. This\n\ncan be used to replace a config value with a value interpolated from the\n\nrandom provider without experiencing diffs.\n\nExample with no prefix:\n\n```sh\n$ pulumi import random:index/randomId:RandomId server p-9hUg\n```\n\nExample with prefix (prefix is separated by a ,):\n\n```sh\n$ pulumi import random:index/randomId:RandomId server my-prefix-,p-9hUg\n```\n\n", + "description": "The resource `random.RandomId` generates random numbers that are intended to be\nused as unique identifiers for other resources. If the output is considered \nsensitive, and should not be displayed in the CLI, use `random.RandomBytes`\ninstead.\n\nThis resource *does* use a cryptographic random number generator in order\nto minimize the chance of collisions, making the results of this resource\nwhen a 16-byte identifier is requested of equivalent uniqueness to a\ntype-4 UUID.\n\nThis resource can be used in conjunction with resources that have\nthe `create_before_destroy` lifecycle flag set to avoid conflicts with\nunique names during the brief period where both the old and new resources\nexist concurrently.\n\n## Example Usage\n\n\u003c!--Start PulumiCodeChooser --\u003e\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as aws from \"@pulumi/aws\";\nimport * as random from \"@pulumi/random\";\n\n// The following example shows how to generate a unique name for an AWS EC2\n// instance that changes each time a new AMI id is selected.\nconst server = new random.RandomId(\"server\", {\n keepers: {\n ami_id: amiId,\n },\n byteLength: 8,\n});\nconst serverInstance = new aws.ec2.Instance(\"server\", {\n tags: {\n Name: pulumi.interpolate`web-server ${server.hex}`,\n },\n ami: server.keepers.apply(keepers =\u003e keepers?.amiId),\n});\n```\n```python\nimport pulumi\nimport pulumi_aws as aws\nimport pulumi_random as random\n\n# The following example shows how to generate a unique name for an AWS EC2\n# instance that changes each time a new AMI id is selected.\nserver = random.RandomId(\"server\",\n keepers={\n \"ami_id\": ami_id,\n },\n byte_length=8)\nserver_instance = aws.ec2.Instance(\"server\",\n tags={\n \"Name\": server.hex.apply(lambda hex: f\"web-server {hex}\"),\n },\n ami=server.keepers[\"amiId\"])\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Aws = Pulumi.Aws;\nusing Random = Pulumi.Random;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n // The following example shows how to generate a unique name for an AWS EC2\n // instance that changes each time a new AMI id is selected.\n var server = new Random.RandomId(\"server\", new()\n {\n Keepers = \n {\n { \"ami_id\", amiId },\n },\n ByteLength = 8,\n });\n\n var serverInstance = new Aws.Ec2.Instance(\"server\", new()\n {\n Tags = \n {\n { \"Name\", server.Hex.Apply(hex =\u003e $\"web-server {hex}\") },\n },\n Ami = server.Keepers.Apply(keepers =\u003e keepers?.AmiId),\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2\"\n\t\"github.com/pulumi/pulumi-random/sdk/v4/go/random\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t// The following example shows how to generate a unique name for an AWS EC2\n\t\t// instance that changes each time a new AMI id is selected.\n\t\tserver, err := random.NewRandomId(ctx, \"server\", \u0026random.RandomIdArgs{\n\t\t\tKeepers: pulumi.StringMap{\n\t\t\t\t\"ami_id\": pulumi.Any(amiId),\n\t\t\t},\n\t\t\tByteLength: pulumi.Int(8),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = ec2.NewInstance(ctx, \"server\", \u0026ec2.InstanceArgs{\n\t\t\tTags: pulumi.StringMap{\n\t\t\t\t\"Name\": server.Hex.ApplyT(func(hex string) (string, error) {\n\t\t\t\t\treturn fmt.Sprintf(\"web-server %v\", hex), nil\n\t\t\t\t}).(pulumi.StringOutput),\n\t\t\t},\n\t\t\tAmi: server.Keepers.ApplyT(func(keepers interface{}) (*string, error) {\n\t\t\t\treturn \u0026keepers.AmiId, nil\n\t\t\t}).(pulumi.StringPtrOutput),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.random.RandomId;\nimport com.pulumi.random.RandomIdArgs;\nimport com.pulumi.aws.ec2.Instance;\nimport com.pulumi.aws.ec2.InstanceArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n // The following example shows how to generate a unique name for an AWS EC2\n // instance that changes each time a new AMI id is selected.\n var server = new RandomId(\"server\", RandomIdArgs.builder() \n .keepers(Map.of(\"ami_id\", amiId))\n .byteLength(8)\n .build());\n\n var serverInstance = new Instance(\"serverInstance\", InstanceArgs.builder() \n .tags(Map.of(\"Name\", server.hex().applyValue(hex -\u003e String.format(\"web-server %s\", hex))))\n .ami(server.keepers().applyValue(keepers -\u003e keepers.amiId()))\n .build());\n\n }\n}\n```\n```yaml\nresources:\n # The following example shows how to generate a unique name for an AWS EC2\n # instance that changes each time a new AMI id is selected.\n server:\n type: random:RandomId\n properties:\n keepers:\n ami_id: ${amiId}\n byteLength: 8\n serverInstance:\n type: aws:ec2:Instance\n name: server\n properties:\n tags:\n Name: web-server ${server.hex}\n ami: ${server.keepers.amiId}\n```\n\u003c!--End PulumiCodeChooser --\u003e\n\n## Import\n\nRandom IDs can be imported using the b64_url with an optional prefix. This\n\ncan be used to replace a config value with a value interpolated from the\n\nrandom provider without experiencing diffs.\n\nExample with no prefix:\n\n```sh\n$ pulumi import random:index/randomId:RandomId server p-9hUg\n```\n\nExample with prefix (prefix is separated by a ,):\n\n```sh\n$ pulumi import random:index/randomId:RandomId server my-prefix-,p-9hUg\n```\n\n", "properties": { "b64Std": { "type": "string", @@ -230,7 +230,7 @@ } }, "random:index/randomInteger:RandomInteger": { - "description": "The resource `random.RandomInteger` generates random values from a given range, described by the `min` and `max` attributes of a given resource.\n\nThis resource can be used in conjunction with resources that have the `create_before_destroy` lifecycle flag set, to avoid conflicts with unique names during the brief period where both the old and new resources exist concurrently.\n\n## Example Usage\n\n\u003c!--Start PulumiCodeChooser --\u003e\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as aws from \"@pulumi/aws\";\nimport * as random from \"@pulumi/random\";\n\n// The following example shows how to generate a random priority\n// between 1 and 50000 for a aws_alb_listener_rule resource:\nconst priority = new random.RandomInteger(\"priority\", {\n min: 1,\n max: 50000,\n keepers: {\n listener_arn: _var.listener_arn,\n },\n});\nconst main = new aws.alb.ListenerRule(\"main\", {\n listenerArn: priority.keepers.apply(keepers =\u003e keepers?.listenerArn),\n priority: priority.result,\n actions: [{\n type: \"forward\",\n targetGroupArn: _var.target_group_arn,\n }],\n});\n// ... (other aws_alb_listener_rule arguments) ...\n```\n```python\nimport pulumi\nimport pulumi_aws as aws\nimport pulumi_random as random\n\n# The following example shows how to generate a random priority\n# between 1 and 50000 for a aws_alb_listener_rule resource:\npriority = random.RandomInteger(\"priority\",\n min=1,\n max=50000,\n keepers={\n \"listener_arn\": var[\"listener_arn\"],\n })\nmain = aws.alb.ListenerRule(\"main\",\n listener_arn=priority.keepers[\"listenerArn\"],\n priority=priority.result,\n actions=[aws.alb.ListenerRuleActionArgs(\n type=\"forward\",\n target_group_arn=var[\"target_group_arn\"],\n )])\n# ... (other aws_alb_listener_rule arguments) ...\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Aws = Pulumi.Aws;\nusing Random = Pulumi.Random;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n // The following example shows how to generate a random priority\n // between 1 and 50000 for a aws_alb_listener_rule resource:\n var priority = new Random.RandomInteger(\"priority\", new()\n {\n Min = 1,\n Max = 50000,\n Keepers = \n {\n { \"listener_arn\", @var.Listener_arn },\n },\n });\n\n var main = new Aws.Alb.ListenerRule(\"main\", new()\n {\n ListenerArn = priority.Keepers.Apply(keepers =\u003e keepers?.ListenerArn),\n Priority = priority.Result,\n Actions = new[]\n {\n new Aws.Alb.Inputs.ListenerRuleActionArgs\n {\n Type = \"forward\",\n TargetGroupArn = @var.Target_group_arn,\n },\n },\n });\n\n // ... (other aws_alb_listener_rule arguments) ...\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/alb\"\n\t\"github.com/pulumi/pulumi-random/sdk/v4/go/random\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t// The following example shows how to generate a random priority\n\t\t// between 1 and 50000 for a aws_alb_listener_rule resource:\n\t\tpriority, err := random.NewRandomInteger(ctx, \"priority\", \u0026random.RandomIntegerArgs{\n\t\t\tMin: pulumi.Int(1),\n\t\t\tMax: pulumi.Int(50000),\n\t\t\tKeepers: pulumi.StringMap{\n\t\t\t\t\"listener_arn\": pulumi.Any(_var.Listener_arn),\n\t\t\t},\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = alb.NewListenerRule(ctx, \"main\", \u0026alb.ListenerRuleArgs{\n\t\t\tListenerArn: priority.Keepers.ApplyT(func(keepers interface{}) (*string, error) {\n\t\t\t\treturn \u0026keepers.ListenerArn, nil\n\t\t\t}).(pulumi.StringPtrOutput),\n\t\t\tPriority: priority.Result,\n\t\t\tActions: alb.ListenerRuleActionArray{\n\t\t\t\t\u0026alb.ListenerRuleActionArgs{\n\t\t\t\t\tType: pulumi.String(\"forward\"),\n\t\t\t\t\tTargetGroupArn: pulumi.Any(_var.Target_group_arn),\n\t\t\t\t},\n\t\t\t},\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.random.RandomInteger;\nimport com.pulumi.random.RandomIntegerArgs;\nimport com.pulumi.aws.alb.ListenerRule;\nimport com.pulumi.aws.alb.ListenerRuleArgs;\nimport com.pulumi.aws.alb.inputs.ListenerRuleActionArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n // The following example shows how to generate a random priority\n // between 1 and 50000 for a aws_alb_listener_rule resource:\n var priority = new RandomInteger(\"priority\", RandomIntegerArgs.builder() \n .min(1)\n .max(50000)\n .keepers(Map.of(\"listener_arn\", var_.listener_arn()))\n .build());\n\n var main = new ListenerRule(\"main\", ListenerRuleArgs.builder() \n .listenerArn(priority.keepers().applyValue(keepers -\u003e keepers.listenerArn()))\n .priority(priority.result())\n .actions(ListenerRuleActionArgs.builder()\n .type(\"forward\")\n .targetGroupArn(var_.target_group_arn())\n .build())\n .build());\n\n // ... (other aws_alb_listener_rule arguments) ...\n }\n}\n```\n```yaml\nresources:\n # The following example shows how to generate a random priority\n # between 1 and 50000 for a aws_alb_listener_rule resource:\n priority:\n type: random:RandomInteger\n properties:\n min: 1\n max: 50000\n keepers:\n listener_arn: ${var.listener_arn}\n main:\n type: aws:alb:ListenerRule\n properties:\n listenerArn: ${priority.keepers.listenerArn}\n priority: ${priority.result}\n actions:\n - type: forward\n targetGroupArn: ${var.target_group_arn}\n```\n\u003c!--End PulumiCodeChooser --\u003e\n\n## Import\n\nRandom integers can be imported using the result, min, and max, with an\n\noptional seed. This can be used to replace a config value with a value\n\ninterpolated from the random provider without experiencing diffs.\n\nExample (values are separated by a ,):\n\n```sh\n$ pulumi import random:index/randomInteger:RandomInteger priority 15390,1,50000\n```\n\n", + "description": "The resource `random.RandomInteger` generates random values from a given range, described by the `min` and `max` attributes of a given resource.\n\nThis resource can be used in conjunction with resources that have the `create_before_destroy` lifecycle flag set, to avoid conflicts with unique names during the brief period where both the old and new resources exist concurrently.\n\n## Example Usage\n\n\u003c!--Start PulumiCodeChooser --\u003e\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as aws from \"@pulumi/aws\";\nimport * as random from \"@pulumi/random\";\n\n// The following example shows how to generate a random priority\n// between 1 and 50000 for a aws_alb_listener_rule resource:\nconst priority = new random.RandomInteger(\"priority\", {\n min: 1,\n max: 50000,\n keepers: {\n listener_arn: listenerArn,\n },\n});\nconst main = new aws.alb.ListenerRule(\"main\", {\n listenerArn: priority.keepers.apply(keepers =\u003e keepers?.listenerArn),\n priority: priority.result,\n actions: [{\n type: \"forward\",\n targetGroupArn: targetGroupArn,\n }],\n});\n```\n```python\nimport pulumi\nimport pulumi_aws as aws\nimport pulumi_random as random\n\n# The following example shows how to generate a random priority\n# between 1 and 50000 for a aws_alb_listener_rule resource:\npriority = random.RandomInteger(\"priority\",\n min=1,\n max=50000,\n keepers={\n \"listener_arn\": listener_arn,\n })\nmain = aws.alb.ListenerRule(\"main\",\n listener_arn=priority.keepers[\"listenerArn\"],\n priority=priority.result,\n actions=[aws.alb.ListenerRuleActionArgs(\n type=\"forward\",\n target_group_arn=target_group_arn,\n )])\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Aws = Pulumi.Aws;\nusing Random = Pulumi.Random;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n // The following example shows how to generate a random priority\n // between 1 and 50000 for a aws_alb_listener_rule resource:\n var priority = new Random.RandomInteger(\"priority\", new()\n {\n Min = 1,\n Max = 50000,\n Keepers = \n {\n { \"listener_arn\", listenerArn },\n },\n });\n\n var main = new Aws.Alb.ListenerRule(\"main\", new()\n {\n ListenerArn = priority.Keepers.Apply(keepers =\u003e keepers?.ListenerArn),\n Priority = priority.Result,\n Actions = new[]\n {\n new Aws.Alb.Inputs.ListenerRuleActionArgs\n {\n Type = \"forward\",\n TargetGroupArn = targetGroupArn,\n },\n },\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/alb\"\n\t\"github.com/pulumi/pulumi-random/sdk/v4/go/random\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t// The following example shows how to generate a random priority\n\t\t// between 1 and 50000 for a aws_alb_listener_rule resource:\n\t\tpriority, err := random.NewRandomInteger(ctx, \"priority\", \u0026random.RandomIntegerArgs{\n\t\t\tMin: pulumi.Int(1),\n\t\t\tMax: pulumi.Int(50000),\n\t\t\tKeepers: pulumi.StringMap{\n\t\t\t\t\"listener_arn\": pulumi.Any(listenerArn),\n\t\t\t},\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = alb.NewListenerRule(ctx, \"main\", \u0026alb.ListenerRuleArgs{\n\t\t\tListenerArn: priority.Keepers.ApplyT(func(keepers interface{}) (*string, error) {\n\t\t\t\treturn \u0026keepers.ListenerArn, nil\n\t\t\t}).(pulumi.StringPtrOutput),\n\t\t\tPriority: priority.Result,\n\t\t\tActions: alb.ListenerRuleActionArray{\n\t\t\t\t\u0026alb.ListenerRuleActionArgs{\n\t\t\t\t\tType: pulumi.String(\"forward\"),\n\t\t\t\t\tTargetGroupArn: pulumi.Any(targetGroupArn),\n\t\t\t\t},\n\t\t\t},\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.random.RandomInteger;\nimport com.pulumi.random.RandomIntegerArgs;\nimport com.pulumi.aws.alb.ListenerRule;\nimport com.pulumi.aws.alb.ListenerRuleArgs;\nimport com.pulumi.aws.alb.inputs.ListenerRuleActionArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n // The following example shows how to generate a random priority\n // between 1 and 50000 for a aws_alb_listener_rule resource:\n var priority = new RandomInteger(\"priority\", RandomIntegerArgs.builder() \n .min(1)\n .max(50000)\n .keepers(Map.of(\"listener_arn\", listenerArn))\n .build());\n\n var main = new ListenerRule(\"main\", ListenerRuleArgs.builder() \n .listenerArn(priority.keepers().applyValue(keepers -\u003e keepers.listenerArn()))\n .priority(priority.result())\n .actions(ListenerRuleActionArgs.builder()\n .type(\"forward\")\n .targetGroupArn(targetGroupArn)\n .build())\n .build());\n\n }\n}\n```\n```yaml\nresources:\n # The following example shows how to generate a random priority\n # between 1 and 50000 for a aws_alb_listener_rule resource:\n priority:\n type: random:RandomInteger\n properties:\n min: 1\n max: 50000\n keepers:\n listener_arn: ${listenerArn}\n main:\n type: aws:alb:ListenerRule\n properties:\n listenerArn: ${priority.keepers.listenerArn}\n priority: ${priority.result}\n actions:\n - type: forward\n targetGroupArn: ${targetGroupArn}\n```\n\u003c!--End PulumiCodeChooser --\u003e\n\n## Import\n\nRandom integers can be imported using the result, min, and max, with an\n\noptional seed. This can be used to replace a config value with a value\n\ninterpolated from the random provider without experiencing diffs.\n\nExample (values are separated by a ,):\n\n```sh\n$ pulumi import random:index/randomInteger:RandomInteger priority 15390,1,50000\n```\n\n", "properties": { "keepers": { "type": "object", @@ -317,7 +317,7 @@ } }, "random:index/randomPassword:RandomPassword": { - "description": "Identical to random_string.\n\nThis resource *does* use a cryptographic random number generator.\n\n## Example Usage\n\n\u003c!--Start PulumiCodeChooser --\u003e\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as aws from \"@pulumi/aws\";\nimport * as random from \"@pulumi/random\";\n\nconst password = new random.RandomPassword(\"password\", {\n length: 16,\n special: true,\n overrideSpecial: \"!#$%\u0026*()-_=+[]{}\u003c\u003e:?\",\n});\nconst example = new aws.rds.Instance(\"example\", {\n instanceClass: aws.rds.InstanceType.T3_Micro,\n allocatedStorage: 64,\n engine: \"mysql\",\n username: \"someone\",\n password: password.result,\n});\n```\n```python\nimport pulumi\nimport pulumi_aws as aws\nimport pulumi_random as random\n\npassword = random.RandomPassword(\"password\",\n length=16,\n special=True,\n override_special=\"!#$%\u0026*()-_=+[]{}\u003c\u003e:?\")\nexample = aws.rds.Instance(\"example\",\n instance_class=aws.rds.InstanceType.T3_MICRO,\n allocated_storage=64,\n engine=\"mysql\",\n username=\"someone\",\n password=password.result)\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Aws = Pulumi.Aws;\nusing Random = Pulumi.Random;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var password = new Random.RandomPassword(\"password\", new()\n {\n Length = 16,\n Special = true,\n OverrideSpecial = \"!#$%\u0026*()-_=+[]{}\u003c\u003e:?\",\n });\n\n var example = new Aws.Rds.Instance(\"example\", new()\n {\n InstanceClass = Aws.Rds.InstanceType.T3_Micro,\n AllocatedStorage = 64,\n Engine = \"mysql\",\n Username = \"someone\",\n Password = password.Result,\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/rds\"\n\t\"github.com/pulumi/pulumi-random/sdk/v4/go/random\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\tpassword, err := random.NewRandomPassword(ctx, \"password\", \u0026random.RandomPasswordArgs{\n\t\t\tLength: pulumi.Int(16),\n\t\t\tSpecial: pulumi.Bool(true),\n\t\t\tOverrideSpecial: pulumi.String(\"!#$%\u0026*()-_=+[]{}\u003c\u003e:?\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = rds.NewInstance(ctx, \"example\", \u0026rds.InstanceArgs{\n\t\t\tInstanceClass: pulumi.String(rds.InstanceType_T3_Micro),\n\t\t\tAllocatedStorage: pulumi.Int(64),\n\t\t\tEngine: pulumi.String(\"mysql\"),\n\t\t\tUsername: pulumi.String(\"someone\"),\n\t\t\tPassword: password.Result,\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.random.RandomPassword;\nimport com.pulumi.random.RandomPasswordArgs;\nimport com.pulumi.aws.rds.Instance;\nimport com.pulumi.aws.rds.InstanceArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n var password = new RandomPassword(\"password\", RandomPasswordArgs.builder() \n .length(16)\n .special(true)\n .overrideSpecial(\"!#$%\u0026*()-_=+[]{}\u003c\u003e:?\")\n .build());\n\n var example = new Instance(\"example\", InstanceArgs.builder() \n .instanceClass(\"db.t3.micro\")\n .allocatedStorage(64)\n .engine(\"mysql\")\n .username(\"someone\")\n .password(password.result())\n .build());\n\n }\n}\n```\n```yaml\nresources:\n password:\n type: random:RandomPassword\n properties:\n length: 16\n special: true\n overrideSpecial: '!#$%\u0026*()-_=+[]{}\u003c\u003e:?'\n example:\n type: aws:rds:Instance\n properties:\n instanceClass: db.t3.micro\n allocatedStorage: 64\n engine: mysql\n username: someone\n password: ${password.result}\n```\n\u003c!--End PulumiCodeChooser --\u003e\n\n## Import\n\nYou can import external passwords into your Pulumi programs as follows:\n\n```sh\u003cbreak\u003e\n$ import random:index/randomPassword:RandomPassword newPassword supersecret\n\u003cbreak\u003e```\n\nThis command will encode the `supersecret` token in Pulumi state and generate a code suggestion to\ninclude a new RandomPassword resource in your Pulumi program. Include the suggested code and do a\n`pulumi up`. Your secret password is now securely stored in Pulumi, and you can reference it in your\nPulumi program as `newPassword.result`.\n", + "description": "Identical to random_string.\n\nThis resource *does* use a cryptographic random number generator.\n\n## Example Usage\n\n\u003c!--Start PulumiCodeChooser --\u003e\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as aws from \"@pulumi/aws\";\nimport * as random from \"@pulumi/random\";\n\nconst password = new random.RandomPassword(\"password\", {\n length: 16,\n special: true,\n overrideSpecial: \"!#$%\u0026*()-_=+[]{}\u003c\u003e:?\",\n});\nconst example = new aws.rds.Instance(\"example\", {\n instanceClass: aws.rds.InstanceType.T3_Micro,\n allocatedStorage: 64,\n engine: \"mysql\",\n username: \"someone\",\n password: password.result,\n});\n```\n```python\nimport pulumi\nimport pulumi_aws as aws\nimport pulumi_random as random\n\npassword = random.RandomPassword(\"password\",\n length=16,\n special=True,\n override_special=\"!#$%\u0026*()-_=+[]{}\u003c\u003e:?\")\nexample = aws.rds.Instance(\"example\",\n instance_class=aws.rds.InstanceType.T3_MICRO,\n allocated_storage=64,\n engine=\"mysql\",\n username=\"someone\",\n password=password.result)\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Aws = Pulumi.Aws;\nusing Random = Pulumi.Random;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var password = new Random.RandomPassword(\"password\", new()\n {\n Length = 16,\n Special = true,\n OverrideSpecial = \"!#$%\u0026*()-_=+[]{}\u003c\u003e:?\",\n });\n\n var example = new Aws.Rds.Instance(\"example\", new()\n {\n InstanceClass = Aws.Rds.InstanceType.T3_Micro,\n AllocatedStorage = 64,\n Engine = \"mysql\",\n Username = \"someone\",\n Password = password.Result,\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/rds\"\n\t\"github.com/pulumi/pulumi-random/sdk/v4/go/random\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\tpassword, err := random.NewRandomPassword(ctx, \"password\", \u0026random.RandomPasswordArgs{\n\t\t\tLength: pulumi.Int(16),\n\t\t\tSpecial: pulumi.Bool(true),\n\t\t\tOverrideSpecial: pulumi.String(\"!#$%\u0026*()-_=+[]{}\u003c\u003e:?\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = rds.NewInstance(ctx, \"example\", \u0026rds.InstanceArgs{\n\t\t\tInstanceClass: pulumi.String(rds.InstanceType_T3_Micro),\n\t\t\tAllocatedStorage: pulumi.Int(64),\n\t\t\tEngine: pulumi.String(\"mysql\"),\n\t\t\tUsername: pulumi.String(\"someone\"),\n\t\t\tPassword: password.Result,\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.random.RandomPassword;\nimport com.pulumi.random.RandomPasswordArgs;\nimport com.pulumi.aws.rds.Instance;\nimport com.pulumi.aws.rds.InstanceArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n var password = new RandomPassword(\"password\", RandomPasswordArgs.builder() \n .length(16)\n .special(true)\n .overrideSpecial(\"!#$%\u0026*()-_=+[]{}\u003c\u003e:?\")\n .build());\n\n var example = new Instance(\"example\", InstanceArgs.builder() \n .instanceClass(\"db.t3.micro\")\n .allocatedStorage(64)\n .engine(\"mysql\")\n .username(\"someone\")\n .password(password.result())\n .build());\n\n }\n}\n```\n```yaml\nresources:\n password:\n type: random:RandomPassword\n properties:\n length: 16\n special: true\n overrideSpecial: '!#$%\u0026*()-_=+[]{}\u003c\u003e:?'\n example:\n type: aws:rds:Instance\n properties:\n instanceClass: db.t3.micro\n allocatedStorage: 64\n engine: mysql\n username: someone\n password: ${password.result}\n```\n\u003c!--End PulumiCodeChooser --\u003e\n\n## Import\n\nYou can import external passwords into your Pulumi programs as follows:\n\n```sh\u003cbreak\u003e\n$ import random:index/randomPassword:RandomPassword newPassword supersecret\n\u003cbreak\u003e```\n\nThis command will encode the `supersecret` token in Pulumi state and generate a code suggestion to\ninclude a new RandomPassword resource in your Pulumi program. Include the suggested code and do a\n`pulumi up`. Your secret password is now securely stored in Pulumi, and you can reference it in your\nPulumi program as `newPassword.result`.\n", "properties": { "bcryptHash": { "type": "string", @@ -523,7 +523,7 @@ } }, "random:index/randomPet:RandomPet": { - "description": "The resource `random.RandomPet` generates random pet names that are intended to be used as unique identifiers for other resources.\n\nThis resource can be used in conjunction with resources that have the `create_before_destroy` lifecycle flag set, to avoid conflicts with unique names during the brief period where both the old and new resources exist concurrently.\n\n## Example Usage\n\n\u003c!--Start PulumiCodeChooser --\u003e\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as aws from \"@pulumi/aws\";\nimport * as random from \"@pulumi/random\";\n\n// The following example shows how to generate a unique pet name\n// for an AWS EC2 instance that changes each time a new AMI id is\n// selected.\nconst serverRandomPet = new random.RandomPet(\"serverRandomPet\", {keepers: {\n ami_id: _var.ami_id,\n}});\nconst serverInstance = new aws.ec2.Instance(\"serverInstance\", {\n tags: {\n Name: pulumi.interpolate`web-server-${serverRandomPet.id}`,\n },\n ami: serverRandomPet.keepers.apply(keepers =\u003e keepers?.amiId),\n});\n// ... (other aws_instance arguments) ...\n```\n```python\nimport pulumi\nimport pulumi_aws as aws\nimport pulumi_random as random\n\n# The following example shows how to generate a unique pet name\n# for an AWS EC2 instance that changes each time a new AMI id is\n# selected.\nserver_random_pet = random.RandomPet(\"serverRandomPet\", keepers={\n \"ami_id\": var[\"ami_id\"],\n})\nserver_instance = aws.ec2.Instance(\"serverInstance\",\n tags={\n \"Name\": server_random_pet.id.apply(lambda id: f\"web-server-{id}\"),\n },\n ami=server_random_pet.keepers[\"amiId\"])\n# ... (other aws_instance arguments) ...\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Aws = Pulumi.Aws;\nusing Random = Pulumi.Random;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n // The following example shows how to generate a unique pet name\n // for an AWS EC2 instance that changes each time a new AMI id is\n // selected.\n var serverRandomPet = new Random.RandomPet(\"serverRandomPet\", new()\n {\n Keepers = \n {\n { \"ami_id\", @var.Ami_id },\n },\n });\n\n var serverInstance = new Aws.Ec2.Instance(\"serverInstance\", new()\n {\n Tags = \n {\n { \"Name\", serverRandomPet.Id.Apply(id =\u003e $\"web-server-{id}\") },\n },\n Ami = serverRandomPet.Keepers.Apply(keepers =\u003e keepers?.AmiId),\n });\n\n // ... (other aws_instance arguments) ...\n});\n```\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/ec2\"\n\t\"github.com/pulumi/pulumi-random/sdk/v4/go/random\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t// The following example shows how to generate a unique pet name\n\t\t// for an AWS EC2 instance that changes each time a new AMI id is\n\t\t// selected.\n\t\tserverRandomPet, err := random.NewRandomPet(ctx, \"serverRandomPet\", \u0026random.RandomPetArgs{\n\t\t\tKeepers: pulumi.StringMap{\n\t\t\t\t\"ami_id\": pulumi.Any(_var.Ami_id),\n\t\t\t},\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = ec2.NewInstance(ctx, \"serverInstance\", \u0026ec2.InstanceArgs{\n\t\t\tTags: pulumi.StringMap{\n\t\t\t\t\"Name\": serverRandomPet.ID().ApplyT(func(id string) (string, error) {\n\t\t\t\t\treturn fmt.Sprintf(\"web-server-%v\", id), nil\n\t\t\t\t}).(pulumi.StringOutput),\n\t\t\t},\n\t\t\tAmi: serverRandomPet.Keepers.ApplyT(func(keepers interface{}) (*string, error) {\n\t\t\t\treturn \u0026keepers.AmiId, nil\n\t\t\t}).(pulumi.StringPtrOutput),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.random.RandomPet;\nimport com.pulumi.random.RandomPetArgs;\nimport com.pulumi.aws.ec2.Instance;\nimport com.pulumi.aws.ec2.InstanceArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n // The following example shows how to generate a unique pet name\n // for an AWS EC2 instance that changes each time a new AMI id is\n // selected.\n var serverRandomPet = new RandomPet(\"serverRandomPet\", RandomPetArgs.builder() \n .keepers(Map.of(\"ami_id\", var_.ami_id()))\n .build());\n\n var serverInstance = new Instance(\"serverInstance\", InstanceArgs.builder() \n .tags(Map.of(\"Name\", serverRandomPet.id().applyValue(id -\u003e String.format(\"web-server-%s\", id))))\n .ami(serverRandomPet.keepers().applyValue(keepers -\u003e keepers.amiId()))\n .build());\n\n // ... (other aws_instance arguments) ...\n }\n}\n```\n```yaml\nresources:\n # The following example shows how to generate a unique pet name\n # for an AWS EC2 instance that changes each time a new AMI id is\n # selected.\n serverRandomPet:\n type: random:RandomPet\n properties:\n keepers:\n ami_id: ${var.ami_id}\n serverInstance:\n type: aws:ec2:Instance\n properties:\n tags:\n Name: web-server-${serverRandomPet.id}\n # Read the AMI id \"through\" the random_pet resource to ensure that\n # # both will change together.\n ami: ${serverRandomPet.keepers.amiId}\n```\n\u003c!--End PulumiCodeChooser --\u003e\n", + "description": "The resource `random.RandomPet` generates random pet names that are intended to be used as unique identifiers for other resources.\n\nThis resource can be used in conjunction with resources that have the `create_before_destroy` lifecycle flag set, to avoid conflicts with unique names during the brief period where both the old and new resources exist concurrently.\n\n## Example Usage\n\n\u003c!--Start PulumiCodeChooser --\u003e\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as aws from \"@pulumi/aws\";\nimport * as random from \"@pulumi/random\";\n\n// The following example shows how to generate a unique pet name\n// for an AWS EC2 instance that changes each time a new AMI id is\n// selected.\nconst server = new random.RandomPet(\"server\", {keepers: {\n ami_id: amiId,\n}});\nconst serverInstance = new aws.ec2.Instance(\"server\", {\n tags: {\n Name: pulumi.interpolate`web-server-${server.id}`,\n },\n ami: server.keepers.apply(keepers =\u003e keepers?.amiId),\n});\n```\n```python\nimport pulumi\nimport pulumi_aws as aws\nimport pulumi_random as random\n\n# The following example shows how to generate a unique pet name\n# for an AWS EC2 instance that changes each time a new AMI id is\n# selected.\nserver = random.RandomPet(\"server\", keepers={\n \"ami_id\": ami_id,\n})\nserver_instance = aws.ec2.Instance(\"server\",\n tags={\n \"Name\": server.id.apply(lambda id: f\"web-server-{id}\"),\n },\n ami=server.keepers[\"amiId\"])\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Aws = Pulumi.Aws;\nusing Random = Pulumi.Random;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n // The following example shows how to generate a unique pet name\n // for an AWS EC2 instance that changes each time a new AMI id is\n // selected.\n var server = new Random.RandomPet(\"server\", new()\n {\n Keepers = \n {\n { \"ami_id\", amiId },\n },\n });\n\n var serverInstance = new Aws.Ec2.Instance(\"server\", new()\n {\n Tags = \n {\n { \"Name\", server.Id.Apply(id =\u003e $\"web-server-{id}\") },\n },\n Ami = server.Keepers.Apply(keepers =\u003e keepers?.AmiId),\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2\"\n\t\"github.com/pulumi/pulumi-random/sdk/v4/go/random\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t// The following example shows how to generate a unique pet name\n\t\t// for an AWS EC2 instance that changes each time a new AMI id is\n\t\t// selected.\n\t\tserver, err := random.NewRandomPet(ctx, \"server\", \u0026random.RandomPetArgs{\n\t\t\tKeepers: pulumi.StringMap{\n\t\t\t\t\"ami_id\": pulumi.Any(amiId),\n\t\t\t},\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = ec2.NewInstance(ctx, \"server\", \u0026ec2.InstanceArgs{\n\t\t\tTags: pulumi.StringMap{\n\t\t\t\t\"Name\": server.ID().ApplyT(func(id string) (string, error) {\n\t\t\t\t\treturn fmt.Sprintf(\"web-server-%v\", id), nil\n\t\t\t\t}).(pulumi.StringOutput),\n\t\t\t},\n\t\t\tAmi: server.Keepers.ApplyT(func(keepers interface{}) (*string, error) {\n\t\t\t\treturn \u0026keepers.AmiId, nil\n\t\t\t}).(pulumi.StringPtrOutput),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.random.RandomPet;\nimport com.pulumi.random.RandomPetArgs;\nimport com.pulumi.aws.ec2.Instance;\nimport com.pulumi.aws.ec2.InstanceArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n // The following example shows how to generate a unique pet name\n // for an AWS EC2 instance that changes each time a new AMI id is\n // selected.\n var server = new RandomPet(\"server\", RandomPetArgs.builder() \n .keepers(Map.of(\"ami_id\", amiId))\n .build());\n\n var serverInstance = new Instance(\"serverInstance\", InstanceArgs.builder() \n .tags(Map.of(\"Name\", server.id().applyValue(id -\u003e String.format(\"web-server-%s\", id))))\n .ami(server.keepers().applyValue(keepers -\u003e keepers.amiId()))\n .build());\n\n }\n}\n```\n```yaml\nresources:\n # The following example shows how to generate a unique pet name\n # for an AWS EC2 instance that changes each time a new AMI id is\n # selected.\n server:\n type: random:RandomPet\n properties:\n keepers:\n ami_id: ${amiId}\n serverInstance:\n type: aws:ec2:Instance\n name: server\n properties:\n tags:\n Name: web-server-${server.id}\n ami: ${server.keepers.amiId}\n```\n\u003c!--End PulumiCodeChooser --\u003e\n", "properties": { "keepers": { "type": "object", @@ -597,7 +597,7 @@ } }, "random:index/randomShuffle:RandomShuffle": { - "description": "The resource `random.RandomShuffle` generates a random permutation of a list of strings given as an argument.\n\n## Example Usage\n\n\u003c!--Start PulumiCodeChooser --\u003e\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as aws from \"@pulumi/aws\";\nimport * as random from \"@pulumi/random\";\n\nconst az = new random.RandomShuffle(\"az\", {\n inputs: [\n \"us-west-1a\",\n \"us-west-1c\",\n \"us-west-1d\",\n \"us-west-1e\",\n ],\n resultCount: 2,\n});\nconst example = new aws.elb.LoadBalancer(\"example\", {availabilityZones: az.results});\n// ... and other aws_elb arguments ...\n```\n```python\nimport pulumi\nimport pulumi_aws as aws\nimport pulumi_random as random\n\naz = random.RandomShuffle(\"az\",\n inputs=[\n \"us-west-1a\",\n \"us-west-1c\",\n \"us-west-1d\",\n \"us-west-1e\",\n ],\n result_count=2)\nexample = aws.elb.LoadBalancer(\"example\", availability_zones=az.results)\n# ... and other aws_elb arguments ...\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Aws = Pulumi.Aws;\nusing Random = Pulumi.Random;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var az = new Random.RandomShuffle(\"az\", new()\n {\n Inputs = new[]\n {\n \"us-west-1a\",\n \"us-west-1c\",\n \"us-west-1d\",\n \"us-west-1e\",\n },\n ResultCount = 2,\n });\n\n var example = new Aws.Elb.LoadBalancer(\"example\", new()\n {\n AvailabilityZones = az.Results,\n });\n\n // ... and other aws_elb arguments ...\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/elb\"\n\t\"github.com/pulumi/pulumi-random/sdk/v4/go/random\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\taz, err := random.NewRandomShuffle(ctx, \"az\", \u0026random.RandomShuffleArgs{\n\t\t\tInputs: pulumi.StringArray{\n\t\t\t\tpulumi.String(\"us-west-1a\"),\n\t\t\t\tpulumi.String(\"us-west-1c\"),\n\t\t\t\tpulumi.String(\"us-west-1d\"),\n\t\t\t\tpulumi.String(\"us-west-1e\"),\n\t\t\t},\n\t\t\tResultCount: pulumi.Int(2),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = elb.NewLoadBalancer(ctx, \"example\", \u0026elb.LoadBalancerArgs{\n\t\t\tAvailabilityZones: az.Results,\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.random.RandomShuffle;\nimport com.pulumi.random.RandomShuffleArgs;\nimport com.pulumi.aws.elb.LoadBalancer;\nimport com.pulumi.aws.elb.LoadBalancerArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n var az = new RandomShuffle(\"az\", RandomShuffleArgs.builder() \n .inputs( \n \"us-west-1a\",\n \"us-west-1c\",\n \"us-west-1d\",\n \"us-west-1e\")\n .resultCount(2)\n .build());\n\n var example = new LoadBalancer(\"example\", LoadBalancerArgs.builder() \n .availabilityZones(az.results())\n .build());\n\n // ... and other aws_elb arguments ...\n }\n}\n```\n```yaml\nresources:\n az:\n type: random:RandomShuffle\n properties:\n inputs:\n - us-west-1a\n - us-west-1c\n - us-west-1d\n - us-west-1e\n resultCount: 2\n example:\n type: aws:elb:LoadBalancer\n properties:\n # Place the ELB in any two of the given availability zones, selected\n # # at random.\n availabilityZones: ${az.results}\n```\n\u003c!--End PulumiCodeChooser --\u003e\n", + "description": "The resource `random.RandomShuffle` generates a random permutation of a list of strings given as an argument.\n\n## Example Usage\n\n\u003c!--Start PulumiCodeChooser --\u003e\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as aws from \"@pulumi/aws\";\nimport * as random from \"@pulumi/random\";\n\nconst az = new random.RandomShuffle(\"az\", {\n inputs: [\n \"us-west-1a\",\n \"us-west-1c\",\n \"us-west-1d\",\n \"us-west-1e\",\n ],\n resultCount: 2,\n});\nconst example = new aws.elb.LoadBalancer(\"example\", {availabilityZones: az.results});\n```\n```python\nimport pulumi\nimport pulumi_aws as aws\nimport pulumi_random as random\n\naz = random.RandomShuffle(\"az\",\n inputs=[\n \"us-west-1a\",\n \"us-west-1c\",\n \"us-west-1d\",\n \"us-west-1e\",\n ],\n result_count=2)\nexample = aws.elb.LoadBalancer(\"example\", availability_zones=az.results)\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Aws = Pulumi.Aws;\nusing Random = Pulumi.Random;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var az = new Random.RandomShuffle(\"az\", new()\n {\n Inputs = new[]\n {\n \"us-west-1a\",\n \"us-west-1c\",\n \"us-west-1d\",\n \"us-west-1e\",\n },\n ResultCount = 2,\n });\n\n var example = new Aws.Elb.LoadBalancer(\"example\", new()\n {\n AvailabilityZones = az.Results,\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/elb\"\n\t\"github.com/pulumi/pulumi-random/sdk/v4/go/random\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\taz, err := random.NewRandomShuffle(ctx, \"az\", \u0026random.RandomShuffleArgs{\n\t\t\tInputs: pulumi.StringArray{\n\t\t\t\tpulumi.String(\"us-west-1a\"),\n\t\t\t\tpulumi.String(\"us-west-1c\"),\n\t\t\t\tpulumi.String(\"us-west-1d\"),\n\t\t\t\tpulumi.String(\"us-west-1e\"),\n\t\t\t},\n\t\t\tResultCount: pulumi.Int(2),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = elb.NewLoadBalancer(ctx, \"example\", \u0026elb.LoadBalancerArgs{\n\t\t\tAvailabilityZones: az.Results,\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.random.RandomShuffle;\nimport com.pulumi.random.RandomShuffleArgs;\nimport com.pulumi.aws.elb.LoadBalancer;\nimport com.pulumi.aws.elb.LoadBalancerArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n var az = new RandomShuffle(\"az\", RandomShuffleArgs.builder() \n .inputs( \n \"us-west-1a\",\n \"us-west-1c\",\n \"us-west-1d\",\n \"us-west-1e\")\n .resultCount(2)\n .build());\n\n var example = new LoadBalancer(\"example\", LoadBalancerArgs.builder() \n .availabilityZones(az.results())\n .build());\n\n }\n}\n```\n```yaml\nresources:\n az:\n type: random:RandomShuffle\n properties:\n inputs:\n - us-west-1a\n - us-west-1c\n - us-west-1d\n - us-west-1e\n resultCount: 2\n example:\n type: aws:elb:LoadBalancer\n properties:\n availabilityZones: ${az.results}\n```\n\u003c!--End PulumiCodeChooser --\u003e\n", "properties": { "inputs": { "type": "array", @@ -697,7 +697,7 @@ } }, "random:index/randomString:RandomString": { - "description": "The resource `random.RandomString` generates a random permutation of alphanumeric characters and optionally special characters.\n\nThis resource *does* use a cryptographic random number generator.\n\nHistorically this resource's intended usage has been ambiguous as the original example used it in a password. For backwards compatibility it will continue to exist. For unique ids please use random_id, for sensitive random values please use random_password.\n\n## Example Usage\n\n\u003c!--Start PulumiCodeChooser --\u003e\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as random from \"@pulumi/random\";\n\nconst random = new random.RandomString(\"random\", {\n length: 16,\n overrideSpecial: \"/@£$\",\n special: true,\n});\n```\n```python\nimport pulumi\nimport pulumi_random as random\n\nrandom = random.RandomString(\"random\",\n length=16,\n override_special=\"/@£$\",\n special=True)\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Random = Pulumi.Random;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var random = new Random.RandomString(\"random\", new()\n {\n Length = 16,\n OverrideSpecial = \"/@£$\",\n Special = true,\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-random/sdk/v4/go/random\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t_, err := random.NewRandomString(ctx, \"random\", \u0026random.RandomStringArgs{\n\t\t\tLength: pulumi.Int(16),\n\t\t\tOverrideSpecial: pulumi.String(\"/@£$\"),\n\t\t\tSpecial: pulumi.Bool(true),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.random.RandomString;\nimport com.pulumi.random.RandomStringArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n var random = new RandomString(\"random\", RandomStringArgs.builder() \n .length(16)\n .overrideSpecial(\"/@£$\")\n .special(true)\n .build());\n\n }\n}\n```\n```yaml\nresources:\n random:\n type: random:RandomString\n properties:\n length: 16\n overrideSpecial: /@£$\n special: true\n```\n\u003c!--End PulumiCodeChooser --\u003e\n\n## Import\n\nYou can import external strings into your Pulumi programs as RandomString resources as follows:\n\n```sh\u003cbreak\u003e\n$ import random:index/randomString:RandomString newString myspecialdata\n\u003cbreak\u003e```\n\nThis command will encode the `myspecialdata` token in Pulumi state and generate a code suggestion to\ninclude a new RandomString resource in your Pulumi program. Include the suggested code and do a\n`pulumi up`. Your data is now stored in Pulumi, and you can reference it in your Pulumi program as\n`newString.result`.\n\nIf the data needs to be stored securily as a secret, consider using the RandomPassword resource\ninstead.\n\n", + "description": "The resource `random.RandomString` generates a random permutation of alphanumeric characters and optionally special characters.\n\nThis resource *does* use a cryptographic random number generator.\n\nHistorically this resource's intended usage has been ambiguous as the original example used it in a password. For backwards compatibility it will continue to exist. For unique ids please use random_id, for sensitive random values please use random_password.\n\n## Example Usage\n\n\u003c!--Start PulumiCodeChooser --\u003e\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as random from \"@pulumi/random\";\n\nconst random = new random.RandomString(\"random\", {\n length: 16,\n special: true,\n overrideSpecial: \"/@£$\",\n});\n```\n```python\nimport pulumi\nimport pulumi_random as random\n\nrandom = random.RandomString(\"random\",\n length=16,\n special=True,\n override_special=\"/@£$\")\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Random = Pulumi.Random;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var random = new Random.RandomString(\"random\", new()\n {\n Length = 16,\n Special = true,\n OverrideSpecial = \"/@£$\",\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-random/sdk/v4/go/random\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t_, err := random.NewRandomString(ctx, \"random\", \u0026random.RandomStringArgs{\n\t\t\tLength: pulumi.Int(16),\n\t\t\tSpecial: pulumi.Bool(true),\n\t\t\tOverrideSpecial: pulumi.String(\"/@£$\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.random.RandomString;\nimport com.pulumi.random.RandomStringArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n var random = new RandomString(\"random\", RandomStringArgs.builder() \n .length(16)\n .special(true)\n .overrideSpecial(\"/@£$\")\n .build());\n\n }\n}\n```\n```yaml\nresources:\n random:\n type: random:RandomString\n properties:\n length: 16\n special: true\n overrideSpecial: /@£$\n```\n\u003c!--End PulumiCodeChooser --\u003e\n\n## Import\n\nYou can import external strings into your Pulumi programs as RandomString resources as follows:\n\n```sh\u003cbreak\u003e\n$ import random:index/randomString:RandomString newString myspecialdata\n\u003cbreak\u003e```\n\nThis command will encode the `myspecialdata` token in Pulumi state and generate a code suggestion to\ninclude a new RandomString resource in your Pulumi program. Include the suggested code and do a\n`pulumi up`. Your data is now stored in Pulumi, and you can reference it in your Pulumi program as\n`newString.result`.\n\nIf the data needs to be stored securily as a secret, consider using the RandomPassword resource\ninstead.\n\n", "properties": { "keepers": { "type": "object", @@ -890,7 +890,7 @@ } }, "random:index/randomUuid:RandomUuid": { - "description": "## Example Usage\n\n\u003c!--Start PulumiCodeChooser --\u003e\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as azure from \"@pulumi/azure\";\nimport * as random from \"@pulumi/random\";\n\nconst testRandomUuid = new random.RandomUuid(\"testRandomUuid\", {});\nconst testResourceGroup = new azure.core.ResourceGroup(\"testResourceGroup\", {location: \"Central US\"});\n```\n```python\nimport pulumi\nimport pulumi_azure as azure\nimport pulumi_random as random\n\ntest_random_uuid = random.RandomUuid(\"testRandomUuid\")\ntest_resource_group = azure.core.ResourceGroup(\"testResourceGroup\", location=\"Central US\")\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Azure = Pulumi.Azure;\nusing Random = Pulumi.Random;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var testRandomUuid = new Random.RandomUuid(\"testRandomUuid\");\n\n var testResourceGroup = new Azure.Core.ResourceGroup(\"testResourceGroup\", new()\n {\n Location = \"Central US\",\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core\"\n\t\"github.com/pulumi/pulumi-random/sdk/v4/go/random\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t_, err := random.NewRandomUuid(ctx, \"testRandomUuid\", nil)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = core.NewResourceGroup(ctx, \"testResourceGroup\", \u0026core.ResourceGroupArgs{\n\t\t\tLocation: pulumi.String(\"Central US\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.random.RandomUuid;\nimport com.pulumi.azure.core.ResourceGroup;\nimport com.pulumi.azure.core.ResourceGroupArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n var testRandomUuid = new RandomUuid(\"testRandomUuid\");\n\n var testResourceGroup = new ResourceGroup(\"testResourceGroup\", ResourceGroupArgs.builder() \n .location(\"Central US\")\n .build());\n\n }\n}\n```\n```yaml\nresources:\n testRandomUuid:\n type: random:RandomUuid\n testResourceGroup:\n type: azure:core:ResourceGroup\n properties:\n location: Central US\n```\n\u003c!--End PulumiCodeChooser --\u003e\n\n## Import\n\nRandom UUID's can be imported. This can be used to replace a config\n\nvalue with a value interpolated from the random provider without\n\nexperiencing diffs.\n\n```sh\n$ pulumi import random:index/randomUuid:RandomUuid main aabbccdd-eeff-0011-2233-445566778899\n```\n\n", + "description": "## Example Usage\n\n\u003c!--Start PulumiCodeChooser --\u003e\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as azurerm from \"@pulumi/azurerm\";\nimport * as random from \"@pulumi/random\";\n\n// The following example shows how to generate a unique name for an Azure Resource Group.\nconst test = new random.RandomUuid(\"test\", {});\nconst testResourceGroup = new azurerm.index.ResourceGroup(\"test\", {\n name: `${test.result}-rg`,\n location: \"Central US\",\n});\n```\n```python\nimport pulumi\nimport pulumi_azurerm as azurerm\nimport pulumi_random as random\n\n# The following example shows how to generate a unique name for an Azure Resource Group.\ntest = random.RandomUuid(\"test\")\ntest_resource_group = azurerm.index.ResourceGroup(\"test\",\n name=f{test.result}-rg,\n location=Central US)\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Azurerm = Pulumi.Azurerm;\nusing Random = Pulumi.Random;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n // The following example shows how to generate a unique name for an Azure Resource Group.\n var test = new Random.RandomUuid(\"test\");\n\n var testResourceGroup = new Azurerm.Index.ResourceGroup(\"test\", new()\n {\n Name = $\"{test.Result}-rg\",\n Location = \"Central US\",\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/pulumi/pulumi-azurerm/sdk/v1/go/azurerm\"\n\t\"github.com/pulumi/pulumi-random/sdk/v4/go/random\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t// The following example shows how to generate a unique name for an Azure Resource Group.\n\t\ttest, err := random.NewRandomUuid(ctx, \"test\", nil)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = index.NewResourceGroup(ctx, \"test\", \u0026index.ResourceGroupArgs{\n\t\t\tName: pulumi.String(fmt.Sprintf(\"%v-rg\", test.Result)),\n\t\t\tLocation: \"Central US\",\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.random.RandomUuid;\nimport com.pulumi.azurerm.resourceGroup;\nimport com.pulumi.azurerm.ResourceGroupArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n // The following example shows how to generate a unique name for an Azure Resource Group.\n var test = new RandomUuid(\"test\");\n\n var testResourceGroup = new ResourceGroup(\"testResourceGroup\", ResourceGroupArgs.builder() \n .name(test.result().applyValue(result -\u003e String.format(\"%s-rg\", result)))\n .location(\"Central US\")\n .build());\n\n }\n}\n```\n```yaml\nresources:\n # The following example shows how to generate a unique name for an Azure Resource Group.\n test:\n type: random:RandomUuid\n testResourceGroup:\n type: azurerm:resourceGroup\n name: test\n properties:\n name: ${test.result}-rg\n location: Central US\n```\n\u003c!--End PulumiCodeChooser --\u003e\n\n## Import\n\nRandom UUID's can be imported. This can be used to replace a config\n\nvalue with a value interpolated from the random provider without\n\nexperiencing diffs.\n\n```sh\n$ pulumi import random:index/randomUuid:RandomUuid main aabbccdd-eeff-0011-2233-445566778899\n```\n\n", "properties": { "keepers": { "type": "object", diff --git a/sdk/dotnet/RandomBytes.cs b/sdk/dotnet/RandomBytes.cs index 486fa631ae..9aa680f170 100644 --- a/sdk/dotnet/RandomBytes.cs +++ b/sdk/dotnet/RandomBytes.cs @@ -21,20 +21,21 @@ namespace Pulumi.Random /// using System.Collections.Generic; /// using System.Linq; /// using Pulumi; - /// using Azure = Pulumi.Azure; + /// using Azurerm = Pulumi.Azurerm; /// using Random = Pulumi.Random; /// /// return await Deployment.RunAsync(() => /// { - /// var jwtSecretRandomBytes = new Random.RandomBytes("jwtSecretRandomBytes", new() + /// var jwtSecret = new Random.RandomBytes("jwt_secret", new() /// { /// Length = 64, /// }); /// - /// var jwtSecretSecret = new Azure.KeyVault.Secret("jwtSecretSecret", new() + /// var jwtSecretKeyVaultSecret = new Azurerm.Index.KeyVaultSecret("jwt_secret", new() /// { /// KeyVaultId = "some-azure-key-vault-id", - /// Value = jwtSecretRandomBytes.Base64, + /// Name = "JwtSecret", + /// Value = jwtSecret.Base64, /// }); /// /// }); diff --git a/sdk/dotnet/RandomId.cs b/sdk/dotnet/RandomId.cs index a2545f7eee..251c0afa33 100644 --- a/sdk/dotnet/RandomId.cs +++ b/sdk/dotnet/RandomId.cs @@ -39,25 +39,24 @@ namespace Pulumi.Random /// { /// // The following example shows how to generate a unique name for an AWS EC2 /// // instance that changes each time a new AMI id is selected. - /// var serverRandomId = new Random.RandomId("serverRandomId", new() + /// var server = new Random.RandomId("server", new() /// { /// Keepers = /// { - /// { "ami_id", @var.Ami_id }, + /// { "ami_id", amiId }, /// }, /// ByteLength = 8, /// }); /// - /// var serverInstance = new Aws.Ec2.Instance("serverInstance", new() + /// var serverInstance = new Aws.Ec2.Instance("server", new() /// { /// Tags = /// { - /// { "Name", serverRandomId.Hex.Apply(hex => $"web-server {hex}") }, + /// { "Name", server.Hex.Apply(hex => $"web-server {hex}") }, /// }, - /// Ami = serverRandomId.Keepers.Apply(keepers => keepers?.AmiId), + /// Ami = server.Keepers.Apply(keepers => keepers?.AmiId), /// }); /// - /// // ... (other aws_instance arguments) ... /// }); /// ``` /// <!--End PulumiCodeChooser --> diff --git a/sdk/dotnet/RandomInteger.cs b/sdk/dotnet/RandomInteger.cs index 541f2ce88e..a96e9b445a 100644 --- a/sdk/dotnet/RandomInteger.cs +++ b/sdk/dotnet/RandomInteger.cs @@ -34,7 +34,7 @@ namespace Pulumi.Random /// Max = 50000, /// Keepers = /// { - /// { "listener_arn", @var.Listener_arn }, + /// { "listener_arn", listenerArn }, /// }, /// }); /// @@ -47,12 +47,11 @@ namespace Pulumi.Random /// new Aws.Alb.Inputs.ListenerRuleActionArgs /// { /// Type = "forward", - /// TargetGroupArn = @var.Target_group_arn, + /// TargetGroupArn = targetGroupArn, /// }, /// }, /// }); /// - /// // ... (other aws_alb_listener_rule arguments) ... /// }); /// ``` /// <!--End PulumiCodeChooser --> diff --git a/sdk/dotnet/RandomPet.cs b/sdk/dotnet/RandomPet.cs index b9d5d2d836..208465bc0b 100644 --- a/sdk/dotnet/RandomPet.cs +++ b/sdk/dotnet/RandomPet.cs @@ -29,24 +29,23 @@ namespace Pulumi.Random /// // The following example shows how to generate a unique pet name /// // for an AWS EC2 instance that changes each time a new AMI id is /// // selected. - /// var serverRandomPet = new Random.RandomPet("serverRandomPet", new() + /// var server = new Random.RandomPet("server", new() /// { /// Keepers = /// { - /// { "ami_id", @var.Ami_id }, + /// { "ami_id", amiId }, /// }, /// }); /// - /// var serverInstance = new Aws.Ec2.Instance("serverInstance", new() + /// var serverInstance = new Aws.Ec2.Instance("server", new() /// { /// Tags = /// { - /// { "Name", serverRandomPet.Id.Apply(id => $"web-server-{id}") }, + /// { "Name", server.Id.Apply(id => $"web-server-{id}") }, /// }, - /// Ami = serverRandomPet.Keepers.Apply(keepers => keepers?.AmiId), + /// Ami = server.Keepers.Apply(keepers => keepers?.AmiId), /// }); /// - /// // ... (other aws_instance arguments) ... /// }); /// ``` /// <!--End PulumiCodeChooser --> diff --git a/sdk/dotnet/RandomShuffle.cs b/sdk/dotnet/RandomShuffle.cs index 2edd79f95b..f1dce2a1c0 100644 --- a/sdk/dotnet/RandomShuffle.cs +++ b/sdk/dotnet/RandomShuffle.cs @@ -41,7 +41,6 @@ namespace Pulumi.Random /// AvailabilityZones = az.Results, /// }); /// - /// // ... and other aws_elb arguments ... /// }); /// ``` /// <!--End PulumiCodeChooser --> diff --git a/sdk/dotnet/RandomString.cs b/sdk/dotnet/RandomString.cs index 90b17fbdd5..e65a5a3730 100644 --- a/sdk/dotnet/RandomString.cs +++ b/sdk/dotnet/RandomString.cs @@ -30,8 +30,8 @@ namespace Pulumi.Random /// var random = new Random.RandomString("random", new() /// { /// Length = 16, - /// OverrideSpecial = "/@£$", /// Special = true, + /// OverrideSpecial = "/@£$", /// }); /// /// }); diff --git a/sdk/dotnet/RandomUuid.cs b/sdk/dotnet/RandomUuid.cs index 21d4e31692..75e47a5428 100644 --- a/sdk/dotnet/RandomUuid.cs +++ b/sdk/dotnet/RandomUuid.cs @@ -17,15 +17,17 @@ namespace Pulumi.Random /// using System.Collections.Generic; /// using System.Linq; /// using Pulumi; - /// using Azure = Pulumi.Azure; + /// using Azurerm = Pulumi.Azurerm; /// using Random = Pulumi.Random; /// /// return await Deployment.RunAsync(() => /// { - /// var testRandomUuid = new Random.RandomUuid("testRandomUuid"); + /// // The following example shows how to generate a unique name for an Azure Resource Group. + /// var test = new Random.RandomUuid("test"); /// - /// var testResourceGroup = new Azure.Core.ResourceGroup("testResourceGroup", new() + /// var testResourceGroup = new Azurerm.Index.ResourceGroup("test", new() /// { + /// Name = $"{test.Result}-rg", /// Location = "Central US", /// }); /// diff --git a/sdk/go/random/randomBytes.go b/sdk/go/random/randomBytes.go index 3840a6b807..e6f65bfe91 100644 --- a/sdk/go/random/randomBytes.go +++ b/sdk/go/random/randomBytes.go @@ -24,7 +24,7 @@ import ( // // import ( // -// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi-azurerm/sdk/v1/go/azurerm" // "github.com/pulumi/pulumi-random/sdk/v4/go/random" // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" // @@ -32,15 +32,16 @@ import ( // // func main() { // pulumi.Run(func(ctx *pulumi.Context) error { -// jwtSecretRandomBytes, err := random.NewRandomBytes(ctx, "jwtSecretRandomBytes", &random.RandomBytesArgs{ +// jwtSecret, err := random.NewRandomBytes(ctx, "jwt_secret", &random.RandomBytesArgs{ // Length: pulumi.Int(64), // }) // if err != nil { // return err // } -// _, err = keyvault.NewSecret(ctx, "jwtSecretSecret", &keyvault.SecretArgs{ -// KeyVaultId: pulumi.String("some-azure-key-vault-id"), -// Value: jwtSecretRandomBytes.Base64, +// _, err = index.NewKeyVaultSecret(ctx, "jwt_secret", &index.KeyVaultSecretArgs{ +// KeyVaultId: "some-azure-key-vault-id", +// Name: "JwtSecret", +// Value: jwtSecret.Base64, // }) // if err != nil { // return err diff --git a/sdk/go/random/randomId.go b/sdk/go/random/randomId.go index eb056bdc0d..f493853305 100644 --- a/sdk/go/random/randomId.go +++ b/sdk/go/random/randomId.go @@ -37,7 +37,7 @@ import ( // // "fmt" // -// "github.com/pulumi/pulumi-aws/sdk/v5/go/aws/ec2" +// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2" // "github.com/pulumi/pulumi-random/sdk/v4/go/random" // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" // @@ -47,22 +47,22 @@ import ( // pulumi.Run(func(ctx *pulumi.Context) error { // // The following example shows how to generate a unique name for an AWS EC2 // // instance that changes each time a new AMI id is selected. -// serverRandomId, err := random.NewRandomId(ctx, "serverRandomId", &random.RandomIdArgs{ +// server, err := random.NewRandomId(ctx, "server", &random.RandomIdArgs{ // Keepers: pulumi.StringMap{ -// "ami_id": pulumi.Any(_var.Ami_id), +// "ami_id": pulumi.Any(amiId), // }, // ByteLength: pulumi.Int(8), // }) // if err != nil { // return err // } -// _, err = ec2.NewInstance(ctx, "serverInstance", &ec2.InstanceArgs{ +// _, err = ec2.NewInstance(ctx, "server", &ec2.InstanceArgs{ // Tags: pulumi.StringMap{ -// "Name": serverRandomId.Hex.ApplyT(func(hex string) (string, error) { +// "Name": server.Hex.ApplyT(func(hex string) (string, error) { // return fmt.Sprintf("web-server %v", hex), nil // }).(pulumi.StringOutput), // }, -// Ami: serverRandomId.Keepers.ApplyT(func(keepers interface{}) (*string, error) { +// Ami: server.Keepers.ApplyT(func(keepers interface{}) (*string, error) { // return &keepers.AmiId, nil // }).(pulumi.StringPtrOutput), // }) diff --git a/sdk/go/random/randomInteger.go b/sdk/go/random/randomInteger.go index c6b61d2000..0455426350 100644 --- a/sdk/go/random/randomInteger.go +++ b/sdk/go/random/randomInteger.go @@ -24,7 +24,7 @@ import ( // // import ( // -// "github.com/pulumi/pulumi-aws/sdk/v5/go/aws/alb" +// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/alb" // "github.com/pulumi/pulumi-random/sdk/v4/go/random" // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" // @@ -38,7 +38,7 @@ import ( // Min: pulumi.Int(1), // Max: pulumi.Int(50000), // Keepers: pulumi.StringMap{ -// "listener_arn": pulumi.Any(_var.Listener_arn), +// "listener_arn": pulumi.Any(listenerArn), // }, // }) // if err != nil { @@ -52,7 +52,7 @@ import ( // Actions: alb.ListenerRuleActionArray{ // &alb.ListenerRuleActionArgs{ // Type: pulumi.String("forward"), -// TargetGroupArn: pulumi.Any(_var.Target_group_arn), +// TargetGroupArn: pulumi.Any(targetGroupArn), // }, // }, // }) diff --git a/sdk/go/random/randomPassword.go b/sdk/go/random/randomPassword.go index fd05ccde9a..a21d236d0f 100644 --- a/sdk/go/random/randomPassword.go +++ b/sdk/go/random/randomPassword.go @@ -24,7 +24,7 @@ import ( // // import ( // -// "github.com/pulumi/pulumi-aws/sdk/v5/go/aws/rds" +// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/rds" // "github.com/pulumi/pulumi-random/sdk/v4/go/random" // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" // diff --git a/sdk/go/random/randomPet.go b/sdk/go/random/randomPet.go index a0e2a0c916..79c5d99750 100644 --- a/sdk/go/random/randomPet.go +++ b/sdk/go/random/randomPet.go @@ -25,7 +25,7 @@ import ( // // "fmt" // -// "github.com/pulumi/pulumi-aws/sdk/v5/go/aws/ec2" +// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2" // "github.com/pulumi/pulumi-random/sdk/v4/go/random" // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" // @@ -36,21 +36,21 @@ import ( // // The following example shows how to generate a unique pet name // // for an AWS EC2 instance that changes each time a new AMI id is // // selected. -// serverRandomPet, err := random.NewRandomPet(ctx, "serverRandomPet", &random.RandomPetArgs{ +// server, err := random.NewRandomPet(ctx, "server", &random.RandomPetArgs{ // Keepers: pulumi.StringMap{ -// "ami_id": pulumi.Any(_var.Ami_id), +// "ami_id": pulumi.Any(amiId), // }, // }) // if err != nil { // return err // } -// _, err = ec2.NewInstance(ctx, "serverInstance", &ec2.InstanceArgs{ +// _, err = ec2.NewInstance(ctx, "server", &ec2.InstanceArgs{ // Tags: pulumi.StringMap{ -// "Name": serverRandomPet.ID().ApplyT(func(id string) (string, error) { +// "Name": server.ID().ApplyT(func(id string) (string, error) { // return fmt.Sprintf("web-server-%v", id), nil // }).(pulumi.StringOutput), // }, -// Ami: serverRandomPet.Keepers.ApplyT(func(keepers interface{}) (*string, error) { +// Ami: server.Keepers.ApplyT(func(keepers interface{}) (*string, error) { // return &keepers.AmiId, nil // }).(pulumi.StringPtrOutput), // }) diff --git a/sdk/go/random/randomShuffle.go b/sdk/go/random/randomShuffle.go index e7867aca39..d10b6f0262 100644 --- a/sdk/go/random/randomShuffle.go +++ b/sdk/go/random/randomShuffle.go @@ -22,7 +22,7 @@ import ( // // import ( // -// "github.com/pulumi/pulumi-aws/sdk/v5/go/aws/elb" +// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/elb" // "github.com/pulumi/pulumi-random/sdk/v4/go/random" // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" // diff --git a/sdk/go/random/randomString.go b/sdk/go/random/randomString.go index 3ab5f834e5..8fb11c80bd 100644 --- a/sdk/go/random/randomString.go +++ b/sdk/go/random/randomString.go @@ -35,8 +35,8 @@ import ( // pulumi.Run(func(ctx *pulumi.Context) error { // _, err := random.NewRandomString(ctx, "random", &random.RandomStringArgs{ // Length: pulumi.Int(16), -// OverrideSpecial: pulumi.String("/@£$"), // Special: pulumi.Bool(true), +// OverrideSpecial: pulumi.String("/@£$"), // }) // if err != nil { // return err diff --git a/sdk/go/random/randomUuid.go b/sdk/go/random/randomUuid.go index 9ffea6a577..15cb478b51 100644 --- a/sdk/go/random/randomUuid.go +++ b/sdk/go/random/randomUuid.go @@ -19,7 +19,9 @@ import ( // // import ( // -// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "fmt" +// +// "github.com/pulumi/pulumi-azurerm/sdk/v1/go/azurerm" // "github.com/pulumi/pulumi-random/sdk/v4/go/random" // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" // @@ -27,12 +29,14 @@ import ( // // func main() { // pulumi.Run(func(ctx *pulumi.Context) error { -// _, err := random.NewRandomUuid(ctx, "testRandomUuid", nil) +// // The following example shows how to generate a unique name for an Azure Resource Group. +// test, err := random.NewRandomUuid(ctx, "test", nil) // if err != nil { // return err // } -// _, err = core.NewResourceGroup(ctx, "testResourceGroup", &core.ResourceGroupArgs{ -// Location: pulumi.String("Central US"), +// _, err = index.NewResourceGroup(ctx, "test", &index.ResourceGroupArgs{ +// Name: pulumi.String(fmt.Sprintf("%v-rg", test.Result)), +// Location: "Central US", // }) // if err != nil { // return err diff --git a/sdk/java/src/main/java/com/pulumi/random/RandomBytes.java b/sdk/java/src/main/java/com/pulumi/random/RandomBytes.java index 015ca724f7..93bee4ccd7 100644 --- a/sdk/java/src/main/java/com/pulumi/random/RandomBytes.java +++ b/sdk/java/src/main/java/com/pulumi/random/RandomBytes.java @@ -33,8 +33,8 @@ * import com.pulumi.core.Output; * import com.pulumi.random.RandomBytes; * import com.pulumi.random.RandomBytesArgs; - * import com.pulumi.azure.keyvault.Secret; - * import com.pulumi.azure.keyvault.SecretArgs; + * import com.pulumi.azurerm.keyVaultSecret; + * import com.pulumi.azurerm.KeyVaultSecretArgs; * import java.util.List; * import java.util.ArrayList; * import java.util.Map; @@ -48,13 +48,14 @@ * } * * public static void stack(Context ctx) { - * var jwtSecretRandomBytes = new RandomBytes("jwtSecretRandomBytes", RandomBytesArgs.builder() + * var jwtSecret = new RandomBytes("jwtSecret", RandomBytesArgs.builder() * .length(64) * .build()); * - * var jwtSecretSecret = new Secret("jwtSecretSecret", SecretArgs.builder() + * var jwtSecretKeyVaultSecret = new KeyVaultSecret("jwtSecretKeyVaultSecret", KeyVaultSecretArgs.builder() * .keyVaultId("some-azure-key-vault-id") - * .value(jwtSecretRandomBytes.base64()) + * .name("JwtSecret") + * .value(jwtSecret.base64()) * .build()); * * } diff --git a/sdk/java/src/main/java/com/pulumi/random/RandomId.java b/sdk/java/src/main/java/com/pulumi/random/RandomId.java index 00bff80f28..d55e0d03ab 100644 --- a/sdk/java/src/main/java/com/pulumi/random/RandomId.java +++ b/sdk/java/src/main/java/com/pulumi/random/RandomId.java @@ -60,17 +60,16 @@ * public static void stack(Context ctx) { * // The following example shows how to generate a unique name for an AWS EC2 * // instance that changes each time a new AMI id is selected. - * var serverRandomId = new RandomId("serverRandomId", RandomIdArgs.builder() - * .keepers(Map.of("ami_id", var_.ami_id())) + * var server = new RandomId("server", RandomIdArgs.builder() + * .keepers(Map.of("ami_id", amiId)) * .byteLength(8) * .build()); * * var serverInstance = new Instance("serverInstance", InstanceArgs.builder() - * .tags(Map.of("Name", serverRandomId.hex().applyValue(hex -> String.format("web-server %s", hex)))) - * .ami(serverRandomId.keepers().applyValue(keepers -> keepers.amiId())) + * .tags(Map.of("Name", server.hex().applyValue(hex -> String.format("web-server %s", hex)))) + * .ami(server.keepers().applyValue(keepers -> keepers.amiId())) * .build()); * - * // ... (other aws_instance arguments) ... * } * } * ``` diff --git a/sdk/java/src/main/java/com/pulumi/random/RandomInteger.java b/sdk/java/src/main/java/com/pulumi/random/RandomInteger.java index 9d1799e6d1..47ea0f15a2 100644 --- a/sdk/java/src/main/java/com/pulumi/random/RandomInteger.java +++ b/sdk/java/src/main/java/com/pulumi/random/RandomInteger.java @@ -53,7 +53,7 @@ * var priority = new RandomInteger("priority", RandomIntegerArgs.builder() * .min(1) * .max(50000) - * .keepers(Map.of("listener_arn", var_.listener_arn())) + * .keepers(Map.of("listener_arn", listenerArn)) * .build()); * * var main = new ListenerRule("main", ListenerRuleArgs.builder() @@ -61,11 +61,10 @@ * .priority(priority.result()) * .actions(ListenerRuleActionArgs.builder() * .type("forward") - * .targetGroupArn(var_.target_group_arn()) + * .targetGroupArn(targetGroupArn) * .build()) * .build()); * - * // ... (other aws_alb_listener_rule arguments) ... * } * } * ``` diff --git a/sdk/java/src/main/java/com/pulumi/random/RandomPet.java b/sdk/java/src/main/java/com/pulumi/random/RandomPet.java index 95890103a7..bd13f83e9b 100644 --- a/sdk/java/src/main/java/com/pulumi/random/RandomPet.java +++ b/sdk/java/src/main/java/com/pulumi/random/RandomPet.java @@ -50,16 +50,15 @@ * // The following example shows how to generate a unique pet name * // for an AWS EC2 instance that changes each time a new AMI id is * // selected. - * var serverRandomPet = new RandomPet("serverRandomPet", RandomPetArgs.builder() - * .keepers(Map.of("ami_id", var_.ami_id())) + * var server = new RandomPet("server", RandomPetArgs.builder() + * .keepers(Map.of("ami_id", amiId)) * .build()); * * var serverInstance = new Instance("serverInstance", InstanceArgs.builder() - * .tags(Map.of("Name", serverRandomPet.id().applyValue(id -> String.format("web-server-%s", id)))) - * .ami(serverRandomPet.keepers().applyValue(keepers -> keepers.amiId())) + * .tags(Map.of("Name", server.id().applyValue(id -> String.format("web-server-%s", id)))) + * .ami(server.keepers().applyValue(keepers -> keepers.amiId())) * .build()); * - * // ... (other aws_instance arguments) ... * } * } * ``` diff --git a/sdk/java/src/main/java/com/pulumi/random/RandomShuffle.java b/sdk/java/src/main/java/com/pulumi/random/RandomShuffle.java index 755cf05798..fbb8d44a54 100644 --- a/sdk/java/src/main/java/com/pulumi/random/RandomShuffle.java +++ b/sdk/java/src/main/java/com/pulumi/random/RandomShuffle.java @@ -59,7 +59,6 @@ * .availabilityZones(az.results()) * .build()); * - * // ... and other aws_elb arguments ... * } * } * ``` diff --git a/sdk/java/src/main/java/com/pulumi/random/RandomString.java b/sdk/java/src/main/java/com/pulumi/random/RandomString.java index d6b22a15b6..c920f774f9 100644 --- a/sdk/java/src/main/java/com/pulumi/random/RandomString.java +++ b/sdk/java/src/main/java/com/pulumi/random/RandomString.java @@ -50,8 +50,8 @@ * public static void stack(Context ctx) { * var random = new RandomString("random", RandomStringArgs.builder() * .length(16) - * .overrideSpecial("/@£$") * .special(true) + * .overrideSpecial("/@£$") * .build()); * * } diff --git a/sdk/java/src/main/java/com/pulumi/random/RandomUuid.java b/sdk/java/src/main/java/com/pulumi/random/RandomUuid.java index 59a5a4b0db..949aa1a8c6 100644 --- a/sdk/java/src/main/java/com/pulumi/random/RandomUuid.java +++ b/sdk/java/src/main/java/com/pulumi/random/RandomUuid.java @@ -26,8 +26,8 @@ * import com.pulumi.Pulumi; * import com.pulumi.core.Output; * import com.pulumi.random.RandomUuid; - * import com.pulumi.azure.core.ResourceGroup; - * import com.pulumi.azure.core.ResourceGroupArgs; + * import com.pulumi.azurerm.resourceGroup; + * import com.pulumi.azurerm.ResourceGroupArgs; * import java.util.List; * import java.util.ArrayList; * import java.util.Map; @@ -41,9 +41,11 @@ * } * * public static void stack(Context ctx) { - * var testRandomUuid = new RandomUuid("testRandomUuid"); + * // The following example shows how to generate a unique name for an Azure Resource Group. + * var test = new RandomUuid("test"); * * var testResourceGroup = new ResourceGroup("testResourceGroup", ResourceGroupArgs.builder() + * .name(test.result().applyValue(result -> String.format("%s-rg", result))) * .location("Central US") * .build()); * diff --git a/sdk/nodejs/randomBytes.ts b/sdk/nodejs/randomBytes.ts index 4edc495952..f8c07a17d0 100644 --- a/sdk/nodejs/randomBytes.ts +++ b/sdk/nodejs/randomBytes.ts @@ -14,13 +14,14 @@ import * as utilities from "./utilities"; * * ```typescript * import * as pulumi from "@pulumi/pulumi"; - * import * as azure from "@pulumi/azure"; + * import * as azurerm from "@pulumi/azurerm"; * import * as random from "@pulumi/random"; * - * const jwtSecretRandomBytes = new random.RandomBytes("jwtSecretRandomBytes", {length: 64}); - * const jwtSecretSecret = new azure.keyvault.Secret("jwtSecretSecret", { + * const jwtSecret = new random.RandomBytes("jwt_secret", {length: 64}); + * const jwtSecretKeyVaultSecret = new azurerm.index.KeyVaultSecret("jwt_secret", { * keyVaultId: "some-azure-key-vault-id", - * value: jwtSecretRandomBytes.base64, + * name: "JwtSecret", + * value: jwtSecret.base64, * }); * ``` * diff --git a/sdk/nodejs/randomId.ts b/sdk/nodejs/randomId.ts index 9021f29aa8..97dc92a78f 100644 --- a/sdk/nodejs/randomId.ts +++ b/sdk/nodejs/randomId.ts @@ -30,19 +30,18 @@ import * as utilities from "./utilities"; * * // The following example shows how to generate a unique name for an AWS EC2 * // instance that changes each time a new AMI id is selected. - * const serverRandomId = new random.RandomId("serverRandomId", { + * const server = new random.RandomId("server", { * keepers: { - * ami_id: _var.ami_id, + * ami_id: amiId, * }, * byteLength: 8, * }); - * const serverInstance = new aws.ec2.Instance("serverInstance", { + * const serverInstance = new aws.ec2.Instance("server", { * tags: { - * Name: pulumi.interpolate`web-server ${serverRandomId.hex}`, + * Name: pulumi.interpolate`web-server ${server.hex}`, * }, - * ami: serverRandomId.keepers.apply(keepers => keepers?.amiId), + * ami: server.keepers.apply(keepers => keepers?.amiId), * }); - * // ... (other aws_instance arguments) ... * ``` * * diff --git a/sdk/nodejs/randomInteger.ts b/sdk/nodejs/randomInteger.ts index e21c12394a..532835c25c 100644 --- a/sdk/nodejs/randomInteger.ts +++ b/sdk/nodejs/randomInteger.ts @@ -23,7 +23,7 @@ import * as utilities from "./utilities"; * min: 1, * max: 50000, * keepers: { - * listener_arn: _var.listener_arn, + * listener_arn: listenerArn, * }, * }); * const main = new aws.alb.ListenerRule("main", { @@ -31,10 +31,9 @@ import * as utilities from "./utilities"; * priority: priority.result, * actions: [{ * type: "forward", - * targetGroupArn: _var.target_group_arn, + * targetGroupArn: targetGroupArn, * }], * }); - * // ... (other aws_alb_listener_rule arguments) ... * ``` * * diff --git a/sdk/nodejs/randomPet.ts b/sdk/nodejs/randomPet.ts index 88294a6416..d6e6b75884 100644 --- a/sdk/nodejs/randomPet.ts +++ b/sdk/nodejs/randomPet.ts @@ -20,16 +20,15 @@ import * as utilities from "./utilities"; * // The following example shows how to generate a unique pet name * // for an AWS EC2 instance that changes each time a new AMI id is * // selected. - * const serverRandomPet = new random.RandomPet("serverRandomPet", {keepers: { - * ami_id: _var.ami_id, + * const server = new random.RandomPet("server", {keepers: { + * ami_id: amiId, * }}); - * const serverInstance = new aws.ec2.Instance("serverInstance", { + * const serverInstance = new aws.ec2.Instance("server", { * tags: { - * Name: pulumi.interpolate`web-server-${serverRandomPet.id}`, + * Name: pulumi.interpolate`web-server-${server.id}`, * }, - * ami: serverRandomPet.keepers.apply(keepers => keepers?.amiId), + * ami: server.keepers.apply(keepers => keepers?.amiId), * }); - * // ... (other aws_instance arguments) ... * ``` * */ diff --git a/sdk/nodejs/randomShuffle.ts b/sdk/nodejs/randomShuffle.ts index 451cb86ec9..0ada88fce1 100644 --- a/sdk/nodejs/randomShuffle.ts +++ b/sdk/nodejs/randomShuffle.ts @@ -25,7 +25,6 @@ import * as utilities from "./utilities"; * resultCount: 2, * }); * const example = new aws.elb.LoadBalancer("example", {availabilityZones: az.results}); - * // ... and other aws_elb arguments ... * ``` * */ diff --git a/sdk/nodejs/randomString.ts b/sdk/nodejs/randomString.ts index 5638f859cb..22eafaf89e 100644 --- a/sdk/nodejs/randomString.ts +++ b/sdk/nodejs/randomString.ts @@ -20,8 +20,8 @@ import * as utilities from "./utilities"; * * const random = new random.RandomString("random", { * length: 16, - * overrideSpecial: "/@£$", * special: true, + * overrideSpecial: "/@£$", * }); * ``` * diff --git a/sdk/nodejs/randomUuid.ts b/sdk/nodejs/randomUuid.ts index 0daa0898c3..0df19a74d3 100644 --- a/sdk/nodejs/randomUuid.ts +++ b/sdk/nodejs/randomUuid.ts @@ -10,11 +10,15 @@ import * as utilities from "./utilities"; * * ```typescript * import * as pulumi from "@pulumi/pulumi"; - * import * as azure from "@pulumi/azure"; + * import * as azurerm from "@pulumi/azurerm"; * import * as random from "@pulumi/random"; * - * const testRandomUuid = new random.RandomUuid("testRandomUuid", {}); - * const testResourceGroup = new azure.core.ResourceGroup("testResourceGroup", {location: "Central US"}); + * // The following example shows how to generate a unique name for an Azure Resource Group. + * const test = new random.RandomUuid("test", {}); + * const testResourceGroup = new azurerm.index.ResourceGroup("test", { + * name: `${test.result}-rg`, + * location: "Central US", + * }); * ``` * * diff --git a/sdk/python/pulumi_random/random_bytes.py b/sdk/python/pulumi_random/random_bytes.py index 8fc2b5027e..74962a4df6 100644 --- a/sdk/python/pulumi_random/random_bytes.py +++ b/sdk/python/pulumi_random/random_bytes.py @@ -140,13 +140,14 @@ def __init__(__self__, ```python import pulumi - import pulumi_azure as azure + import pulumi_azurerm as azurerm import pulumi_random as random - jwt_secret_random_bytes = random.RandomBytes("jwtSecretRandomBytes", length=64) - jwt_secret_secret = azure.keyvault.Secret("jwtSecretSecret", - key_vault_id="some-azure-key-vault-id", - value=jwt_secret_random_bytes.base64) + jwt_secret = random.RandomBytes("jwt_secret", length=64) + jwt_secret_key_vault_secret = azurerm.index.KeyVaultSecret("jwt_secret", + key_vault_id=some-azure-key-vault-id, + name=JwtSecret, + value=jwt_secret.base64) ``` @@ -179,13 +180,14 @@ def __init__(__self__, ```python import pulumi - import pulumi_azure as azure + import pulumi_azurerm as azurerm import pulumi_random as random - jwt_secret_random_bytes = random.RandomBytes("jwtSecretRandomBytes", length=64) - jwt_secret_secret = azure.keyvault.Secret("jwtSecretSecret", - key_vault_id="some-azure-key-vault-id", - value=jwt_secret_random_bytes.base64) + jwt_secret = random.RandomBytes("jwt_secret", length=64) + jwt_secret_key_vault_secret = azurerm.index.KeyVaultSecret("jwt_secret", + key_vault_id=some-azure-key-vault-id, + name=JwtSecret, + value=jwt_secret.base64) ``` diff --git a/sdk/python/pulumi_random/random_id.py b/sdk/python/pulumi_random/random_id.py index fb23478779..3d032454ab 100644 --- a/sdk/python/pulumi_random/random_id.py +++ b/sdk/python/pulumi_random/random_id.py @@ -221,17 +221,16 @@ def __init__(__self__, # The following example shows how to generate a unique name for an AWS EC2 # instance that changes each time a new AMI id is selected. - server_random_id = random.RandomId("serverRandomId", + server = random.RandomId("server", keepers={ - "ami_id": var["ami_id"], + "ami_id": ami_id, }, byte_length=8) - server_instance = aws.ec2.Instance("serverInstance", + server_instance = aws.ec2.Instance("server", tags={ - "Name": server_random_id.hex.apply(lambda hex: f"web-server {hex}"), + "Name": server.hex.apply(lambda hex: f"web-server {hex}"), }, - ami=server_random_id.keepers["amiId"]) - # ... (other aws_instance arguments) ... + ami=server.keepers["amiId"]) ``` @@ -293,17 +292,16 @@ def __init__(__self__, # The following example shows how to generate a unique name for an AWS EC2 # instance that changes each time a new AMI id is selected. - server_random_id = random.RandomId("serverRandomId", + server = random.RandomId("server", keepers={ - "ami_id": var["ami_id"], + "ami_id": ami_id, }, byte_length=8) - server_instance = aws.ec2.Instance("serverInstance", + server_instance = aws.ec2.Instance("server", tags={ - "Name": server_random_id.hex.apply(lambda hex: f"web-server {hex}"), + "Name": server.hex.apply(lambda hex: f"web-server {hex}"), }, - ami=server_random_id.keepers["amiId"]) - # ... (other aws_instance arguments) ... + ami=server.keepers["amiId"]) ``` diff --git a/sdk/python/pulumi_random/random_integer.py b/sdk/python/pulumi_random/random_integer.py index ff298d5aaf..a87d54cbd8 100644 --- a/sdk/python/pulumi_random/random_integer.py +++ b/sdk/python/pulumi_random/random_integer.py @@ -198,16 +198,15 @@ def __init__(__self__, min=1, max=50000, keepers={ - "listener_arn": var["listener_arn"], + "listener_arn": listener_arn, }) main = aws.alb.ListenerRule("main", listener_arn=priority.keepers["listenerArn"], priority=priority.result, actions=[aws.alb.ListenerRuleActionArgs( type="forward", - target_group_arn=var["target_group_arn"], + target_group_arn=target_group_arn, )]) - # ... (other aws_alb_listener_rule arguments) ... ``` @@ -257,16 +256,15 @@ def __init__(__self__, min=1, max=50000, keepers={ - "listener_arn": var["listener_arn"], + "listener_arn": listener_arn, }) main = aws.alb.ListenerRule("main", listener_arn=priority.keepers["listenerArn"], priority=priority.result, actions=[aws.alb.ListenerRuleActionArgs( type="forward", - target_group_arn=var["target_group_arn"], + target_group_arn=target_group_arn, )]) - # ... (other aws_alb_listener_rule arguments) ... ``` diff --git a/sdk/python/pulumi_random/random_pet.py b/sdk/python/pulumi_random/random_pet.py index 007c27e829..06ca2571af 100644 --- a/sdk/python/pulumi_random/random_pet.py +++ b/sdk/python/pulumi_random/random_pet.py @@ -181,15 +181,14 @@ def __init__(__self__, # The following example shows how to generate a unique pet name # for an AWS EC2 instance that changes each time a new AMI id is # selected. - server_random_pet = random.RandomPet("serverRandomPet", keepers={ - "ami_id": var["ami_id"], + server = random.RandomPet("server", keepers={ + "ami_id": ami_id, }) - server_instance = aws.ec2.Instance("serverInstance", + server_instance = aws.ec2.Instance("server", tags={ - "Name": server_random_pet.id.apply(lambda id: f"web-server-{id}"), + "Name": server.id.apply(lambda id: f"web-server-{id}"), }, - ami=server_random_pet.keepers["amiId"]) - # ... (other aws_instance arguments) ... + ami=server.keepers["amiId"]) ``` @@ -222,15 +221,14 @@ def __init__(__self__, # The following example shows how to generate a unique pet name # for an AWS EC2 instance that changes each time a new AMI id is # selected. - server_random_pet = random.RandomPet("serverRandomPet", keepers={ - "ami_id": var["ami_id"], + server = random.RandomPet("server", keepers={ + "ami_id": ami_id, }) - server_instance = aws.ec2.Instance("serverInstance", + server_instance = aws.ec2.Instance("server", tags={ - "Name": server_random_pet.id.apply(lambda id: f"web-server-{id}"), + "Name": server.id.apply(lambda id: f"web-server-{id}"), }, - ami=server_random_pet.keepers["amiId"]) - # ... (other aws_instance arguments) ... + ami=server.keepers["amiId"]) ``` diff --git a/sdk/python/pulumi_random/random_shuffle.py b/sdk/python/pulumi_random/random_shuffle.py index 31727bbd05..10dfb1bbdb 100644 --- a/sdk/python/pulumi_random/random_shuffle.py +++ b/sdk/python/pulumi_random/random_shuffle.py @@ -202,7 +202,6 @@ def __init__(__self__, ], result_count=2) example = aws.elb.LoadBalancer("example", availability_zones=az.results) - # ... and other aws_elb arguments ... ``` @@ -239,7 +238,6 @@ def __init__(__self__, ], result_count=2) example = aws.elb.LoadBalancer("example", availability_zones=az.results) - # ... and other aws_elb arguments ... ``` diff --git a/sdk/python/pulumi_random/random_string.py b/sdk/python/pulumi_random/random_string.py index d13554dd40..edc8f43d8a 100644 --- a/sdk/python/pulumi_random/random_string.py +++ b/sdk/python/pulumi_random/random_string.py @@ -472,8 +472,8 @@ def __init__(__self__, random = random.RandomString("random", length=16, - override_special="/@£$", - special=True) + special=True, + override_special="/@£$") ``` @@ -518,8 +518,8 @@ def __init__(__self__, random = random.RandomString("random", length=16, - override_special="/@£$", - special=True) + special=True, + override_special="/@£$") ``` diff --git a/sdk/python/pulumi_random/random_uuid.py b/sdk/python/pulumi_random/random_uuid.py index 9601c30cf7..544d46f0b4 100644 --- a/sdk/python/pulumi_random/random_uuid.py +++ b/sdk/python/pulumi_random/random_uuid.py @@ -88,11 +88,14 @@ def __init__(__self__, ```python import pulumi - import pulumi_azure as azure + import pulumi_azurerm as azurerm import pulumi_random as random - test_random_uuid = random.RandomUuid("testRandomUuid") - test_resource_group = azure.core.ResourceGroup("testResourceGroup", location="Central US") + # The following example shows how to generate a unique name for an Azure Resource Group. + test = random.RandomUuid("test") + test_resource_group = azurerm.index.ResourceGroup("test", + name=f{test.result}-rg, + location=Central US) ``` @@ -124,11 +127,14 @@ def __init__(__self__, ```python import pulumi - import pulumi_azure as azure + import pulumi_azurerm as azurerm import pulumi_random as random - test_random_uuid = random.RandomUuid("testRandomUuid") - test_resource_group = azure.core.ResourceGroup("testResourceGroup", location="Central US") + # The following example shows how to generate a unique name for an Azure Resource Group. + test = random.RandomUuid("test") + test_resource_group = azurerm.index.ResourceGroup("test", + name=f{test.result}-rg, + location=Central US) ```