├── .devcontainer ├── Dockerfile └── devcontainer.json ├── .github └── workflows │ ├── lint.yml │ ├── pr-check-signed-commits.yml │ ├── release.yml │ └── upgrade-provider.yml ├── .gitignore ├── .golangci.yml ├── .goreleaser.yml ├── .pulumi-java-gen.version ├── .upgrade-config.yml ├── CHANGELOG.md ├── CODE-OF-CONDUCT.md ├── CONTRIBUTING.md ├── COPYRIGHT ├── LICENSE ├── Makefile ├── README.md ├── docs ├── _index.md └── installation-configuration.md ├── examples ├── .gitignore ├── examples_nodejs_test.go ├── examples_py_test.go ├── examples_test.go ├── go.mod ├── go.sum └── provider-example │ └── ts │ ├── .gitignore │ ├── Pulumi.yaml │ ├── index.ts │ ├── package.json │ └── tsconfig.json ├── go.work ├── go.work.sum ├── provider ├── cmd │ ├── pulumi-resource-onepassword │ │ ├── .gitignore │ │ ├── Pulumi.yaml │ │ ├── bridge-metadata.json │ │ ├── generate.go │ │ ├── main.go │ │ └── schema.json │ └── pulumi-tfgen-onepassword │ │ └── main.go ├── go.mod ├── go.sum ├── pkg │ └── version │ │ └── version.go └── resources.go └── sdk ├── .gitignore ├── dotnet ├── Config │ ├── Config.cs │ └── README.md ├── GetItem.cs ├── GetVault.cs ├── Inputs │ ├── GetItemFile.cs │ ├── GetItemFileArgs.cs │ ├── GetItemSection.cs │ ├── GetItemSectionArgs.cs │ ├── GetItemSectionField.cs │ ├── GetItemSectionFieldArgs.cs │ ├── GetItemSectionFile.cs │ ├── GetItemSectionFileArgs.cs │ ├── ItemPasswordRecipeArgs.cs │ ├── ItemPasswordRecipeGetArgs.cs │ ├── ItemSectionArgs.cs │ ├── ItemSectionFieldArgs.cs │ ├── ItemSectionFieldGetArgs.cs │ ├── ItemSectionFieldPasswordRecipeArgs.cs │ ├── ItemSectionFieldPasswordRecipeGetArgs.cs │ └── ItemSectionGetArgs.cs ├── Item.cs ├── Outputs │ ├── GetItemFileResult.cs │ ├── GetItemSectionFieldResult.cs │ ├── GetItemSectionFileResult.cs │ ├── GetItemSectionResult.cs │ ├── ItemPasswordRecipe.cs │ ├── ItemSection.cs │ ├── ItemSectionField.cs │ └── ItemSectionFieldPasswordRecipe.cs ├── Provider.cs ├── Pulumi.Onepassword.csproj ├── Pulumi.yaml ├── README.md ├── Utilities.cs ├── logo.png └── pulumi-plugin.json ├── go.mod ├── go.sum ├── go ├── Pulumi.yaml └── onepassword │ ├── config │ └── config.go │ ├── doc.go │ ├── getItem.go │ ├── getVault.go │ ├── init.go │ ├── internal │ ├── pulumiUtilities.go │ └── pulumiVersion.go │ ├── item.go │ ├── provider.go │ ├── pulumi-plugin.json │ └── pulumiTypes.go ├── nodejs ├── Pulumi.yaml ├── README.md ├── config │ ├── index.ts │ └── vars.ts ├── getItem.ts ├── getVault.ts ├── index.ts ├── item.ts ├── package.json ├── provider.ts ├── tsconfig.json ├── types │ ├── index.ts │ ├── input.ts │ └── output.ts └── utilities.ts └── python ├── Pulumi.yaml ├── README.md ├── pulumi_onepassword ├── README.md ├── __init__.py ├── _inputs.py ├── _utilities.py ├── config │ ├── __init__.py │ ├── __init__.pyi │ └── vars.py ├── get_item.py ├── get_vault.py ├── item.py ├── outputs.py ├── provider.py ├── pulumi-plugin.json └── py.typed └── setup.py /.devcontainer/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG UBUNTU_VERSION=latest 2 | FROM ubuntu:${UBUNTU_VERSION} 3 | 4 | # Update apt-get and install various needed utilities 5 | RUN apt-get update && \ 6 | apt-get install -y curl && \ 7 | apt-get install -y wget && \ 8 | apt-get install -y xz-utils && \ 9 | apt-get install -y make && \ 10 | apt-get install -y gcc && \ 11 | apt-get install -y git 12 | 13 | # Install bridged provider prerequisites 14 | # See README.md 15 | 16 | # Install go 17 | ARG GO_VERSION=1.18.3 18 | RUN rm -rf /usr/local/go && \ 19 | wget -O ${GO_VERSION}.tar.gz https://golang.org/dl/go${GO_VERSION}.linux-amd64.tar.gz && \ 20 | tar -C /usr/local -xzf ${GO_VERSION}.tar.gz && \ 21 | rm ${GO_VERSION}.tar.gz 22 | 23 | ENV GOPATH=/root/go 24 | ENV PATH=$PATH:/usr/local/go/bin 25 | 26 | # Install go linter 27 | RUN mkdir -p $GOPATH/bin && \ 28 | curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $GOPATH/bin v1.46.2 29 | 30 | ENV PATH=$PATH:$GOPATH/bin 31 | 32 | # Install pulumictl 33 | ARG PULUMICTL_VERSION=v0.0.32 34 | RUN rm -rf /usr/local/bin/pulumictl && \ 35 | wget -O pulumictl.${PULUMICTL_VERSION}.tar.gz https://github.com/pulumi/pulumictl/releases/download/${PULUMICTL_VERSION}/pulumictl-${PULUMICTL_VERSION}-linux-amd64.tar.gz && \ 36 | tar -C /usr/local/bin -xzf pulumictl.${PULUMICTL_VERSION}.tar.gz 37 | 38 | # Install nodejs 39 | ARG NODEJS_VERSION=v16.16.0 40 | ARG NODEJS_PKG=node-${NODEJS_VERSION}-linux-x64 41 | ARG NODEJS_TARBALL=${NODEJS_PKG}.tar.xz 42 | RUN rm -rf /usr/local/node && \ 43 | wget -O ${NODEJS_TARBALL} https://nodejs.org/dist/${NODEJS_VERSION}/${NODEJS_TARBALL} && \ 44 | tar -C /usr/local -xf ${NODEJS_TARBALL} && \ 45 | mv /usr/local/${NODEJS_PKG} /usr/local/node 46 | 47 | ENV PATH=$PATH:/usr/local/node/bin 48 | 49 | # Install yarn 50 | RUN npm install --global yarn 51 | 52 | # Install python and related items 53 | RUN apt-get install -y python3 && \ 54 | apt-get install -y python3-setuptools 55 | 56 | # Install .NET 57 | # https://stackoverflow.com/questions/73753672/a-fatal-error-occurred-the-folder-usr-share-dotnet-host-fxr-does-not-exist 58 | RUN apt-get remove dotnet* && \ 59 | apt-get remove aspnetcore* && \ 60 | apt-get remove netstandard& 61 | 62 | RUN apt-get update && \ 63 | apt-get install dotnet-sdk-6.0 -y 64 | 65 | # Install Pulumi 66 | RUN curl -fsSL https://get.pulumi.com | sh 67 | ENV PATH=$PATH:/root/.pulumi/bin 68 | -------------------------------------------------------------------------------- /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | // For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: 2 | // https://github.com/microsoft/vscode-dev-containers/tree/v0.202.3/containers/hugo 3 | { 4 | "name": "TFProvider", 5 | "build": { 6 | "dockerfile": "Dockerfile" 7 | } 8 | } -------------------------------------------------------------------------------- /.github/workflows/lint.yml: -------------------------------------------------------------------------------- 1 | name: lint 2 | 3 | on: 4 | workflow_call: 5 | inputs: {} 6 | pull_request: 7 | branches: 8 | - main 9 | - v* 10 | - feature* 11 | paths-ignore: 12 | - CHANGELOG.md 13 | 14 | env: 15 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 16 | 17 | jobs: 18 | lint: 19 | name: lint 20 | runs-on: ubuntu-latest 21 | steps: 22 | - name: Checkout Repo 23 | uses: actions/checkout@v4 24 | - name: Install go 25 | uses: actions/setup-go@v5 26 | with: 27 | # The versions of golangci-lint and setup-go here cross-depend and need to update together. 28 | go-version: 1.21 29 | # Either this action or golangci-lint needs to disable the cache 30 | cache: false 31 | - name: disarm go:embed directives to enable lint 32 | continue-on-error: true # this fails if there are no go:embed directives 33 | run: | 34 | git grep -l 'go:embed' -- provider | xargs sed -i 's/go:embed/ goembed/g' 35 | - name: prepare upstream 36 | continue-on-error: true 37 | run: make upstream 38 | - run: cd provider && go mod tidy 39 | - name: golangci-lint 40 | uses: golangci/golangci-lint-action@v6 41 | with: 42 | working-directory: provider 43 | -------------------------------------------------------------------------------- /.github/workflows/pr-check-signed-commits.yml: -------------------------------------------------------------------------------- 1 | name: Check signed commits in PR 2 | on: pull_request_target 3 | 4 | jobs: 5 | build: 6 | name: Check signed commits in PR 7 | permissions: 8 | contents: read 9 | pull-requests: write 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: Check signed commits in PR 13 | uses: 1Password/check-signed-commits-action@v1 14 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: release 2 | on: 3 | push: 4 | tags: 5 | - v*.*.* 6 | env: 7 | # THIS GITHUB_TOKEN IS A REQUIREMENT TO BE ABLE TO WRITE TO GH RELEASES 8 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 9 | # IF YOU NEED TO PUBLISH A NPM PACKAGE THEN ENSURE A NPM_TOKEN SECRET IS SET 10 | # AND PUBLISH_NPM: TRUE. IF YOU WANT TO PUBLISH TO A PRIVATE NPM REGISTRY 11 | # THEN ENSURE THE NPM_REGISTRY_URL IS CHANGED 12 | NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} 13 | NPM_TOKEN: ${{ secrets.NPM_TOKEN }} 14 | PUBLISH_NPM: true 15 | NPM_REGISTRY_URL: https://registry.npmjs.org 16 | # Skip NuGet publishing for now. 17 | # IF YOU NEED TO PUBLISH A NUGET PACKAGE THEN ENSURE AN NUGET_PUBLISH_KEY 18 | # SECRET IS SET AND PUBLISH_NUGET: TRUE. IF YOU WANT TO PUBLISH TO AN ALTERNATIVE 19 | # NUGET FEED THEN ENSURE THE NUGET_FEED_URL IS CHANGED. 20 | # NUGET_PUBLISH_KEY: ${{ YOUR NUGET PUBLISH KEY HERE }} 21 | NUGET_FEED_URL: https://api.nuget.org/v3/index.json 22 | PUBLISH_NUGET: false 23 | # IF YOU NEED TO PUBLISH A PYPI PACKAGE SET PUBLISH_PYPI: TRUE AND CHANGE PYPI_PASSWORD, PYPI_USERNAME TO YOUR CREDENTIALS. 24 | # IF YOU WANT TO PUBLISH TO AN ALTERNATIVE PYPI REGISTRY THEN ENSURE THE PYPI_REPOSITORY_URL IS SET. 25 | PYPI_USERNAME: __token__ 26 | PYPI_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} 27 | PYPI_REPOSITORY_URL: "" 28 | PUBLISH_PYPI: true 29 | jobs: 30 | publish_binary: 31 | name: publish 32 | runs-on: ubuntu-latest 33 | steps: 34 | - name: Checkout Repo 35 | uses: actions/checkout@v4 36 | - name: Unshallow clone for tags 37 | run: git fetch --prune --unshallow --tags 38 | - name: Install Go 39 | uses: actions/setup-go@v5 40 | with: 41 | go-version: ${{ matrix.goversion }} 42 | - name: Install pulumictl 43 | uses: jaxxstorm/action-install-gh-release@v1 44 | with: 45 | repo: pulumi/pulumictl 46 | - name: Set PreRelease Version 47 | run: echo "GORELEASER_CURRENT_TAG=v$(pulumictl get version --language generic)" >> $GITHUB_ENV 48 | - name: Run GoReleaser 49 | uses: goreleaser/goreleaser-action@v5 50 | with: 51 | args: -p 3 release --rm-dist 52 | version: latest 53 | strategy: 54 | fail-fast: true 55 | matrix: 56 | goversion: 57 | - 1.21.x 58 | publish_sdk: 59 | name: Publish SDKs 60 | runs-on: ubuntu-latest 61 | needs: publish_binary 62 | steps: 63 | - name: Checkout Repo 64 | uses: actions/checkout@v4 65 | 66 | - name: Unshallow clone for tags 67 | run: git fetch --prune --unshallow --tags 68 | 69 | - name: Install Go 70 | uses: actions/setup-go@v5 71 | with: 72 | go-version: ${{ matrix.goversion }} 73 | 74 | - name: Install pulumictl 75 | uses: jaxxstorm/action-install-gh-release@v1 76 | with: 77 | repo: pulumi/pulumictl 78 | 79 | - name: Install pulumi 80 | uses: pulumi/actions@v5 81 | 82 | - name: Setup Node 83 | uses: actions/setup-node@v4 84 | with: 85 | node-version: ${{ matrix.nodeversion }} 86 | registry-url: ${{ env.NPM_REGISTRY_URL }} 87 | 88 | - name: Setup DotNet 89 | uses: actions/setup-dotnet@v4 90 | with: 91 | dotnet-version: ${{ matrix.dotnetverson }} 92 | 93 | - name: Setup Python 94 | uses: actions/setup-python@v5 95 | with: 96 | python-version: ${{ matrix.pythonversion }} 97 | 98 | - name: Build SDK 99 | run: make build_${{ matrix.language }} 100 | 101 | # Usually there are no Git diffs produced in the pipeline, however there are currently two files manually excluded 102 | # (see below) since the `make tfgen` and `make build_sdks` commands both produce small Git diffs due to a bug in the 103 | # Pulumi code generation process where the custom package name is not being used: 104 | # https://github.com/pulumi/pulumi/issues/15979 105 | - name: Check worktree clean 106 | run: | 107 | git update-index -q --refresh 108 | if ! git diff-files --quiet \ 109 | ':(exclude)provider/cmd/pulumi-resource-onepassword/schema.json' \ 110 | ':(exclude)sdk/nodejs/getItem.ts' \ 111 | ':(exclude)sdk/nodejs/getVault.ts'; then 112 | >&2 echo "error: working tree is not clean, aborting!" 113 | git status 114 | git diff 115 | exit 1 116 | fi 117 | 118 | - if: ${{ matrix.language == 'python' && env.PUBLISH_PYPI == 'true' }} 119 | name: Publish to PyPI 120 | uses: pypa/gh-action-pypi-publish@release/v1 121 | with: 122 | user: ${{ env.PYPI_USERNAME }} 123 | password: ${{ env.PYPI_PASSWORD }} 124 | packages-dir: ${{github.workspace}}/sdk/python/bin/dist 125 | 126 | - if: ${{ matrix.language == 'nodejs' && env.PUBLISH_NPM == 'true' }} 127 | name: Publish to NPM 128 | uses: JS-DevTools/npm-publish@v3 129 | with: 130 | access: "public" 131 | token: ${{ env.NPM_TOKEN }} 132 | package: ${{github.workspace}}/sdk/nodejs/bin/package.json 133 | 134 | - if: ${{ matrix.language == 'dotnet' && env.PUBLISH_NUGET == 'true' }} 135 | name: Publish to NuGet 136 | run: | 137 | dotnet nuget push ${{github.workspace}}/sdk/dotnet/bin/Debug/*.nupkg -s ${{ env.NUGET_FEED_URL }} -k ${{ env.NUGET_PUBLISH_KEY }} 138 | echo "done publishing packages" 139 | 140 | strategy: 141 | fail-fast: true 142 | matrix: 143 | dotnetversion: 144 | - 3.1.301 145 | goversion: 146 | - 1.21.x 147 | language: 148 | - nodejs 149 | - python 150 | - dotnet 151 | - go 152 | nodeversion: 153 | - 20.x 154 | pythonversion: 155 | - "3.9" 156 | -------------------------------------------------------------------------------- /.github/workflows/upgrade-provider.yml: -------------------------------------------------------------------------------- 1 | name: upgrade_provider 2 | 3 | on: 4 | workflow_dispatch: 5 | schedule: 6 | # https://crontab.guru/#00_07_*_*_MON = "At 07:00 (UTC) on Monday." 7 | - cron: 00 07 * * MON 8 | 9 | jobs: 10 | upgrade_provider: 11 | name: upgrade_provider 12 | runs-on: ubuntu-latest 13 | permissions: 14 | contents: write 15 | pull-requests: write 16 | issues: write 17 | steps: 18 | - name: Call upgrade provider action 19 | uses: pulumi/pulumi-upgrade-provider-action@v0.0.12 20 | env: 21 | GH_TOKEN: ${{ secrets.PULUMI_1P_UPGRADE_PROVIDER_GH_TOKEN }} 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .code 3 | **/vendor/ 4 | .pulumi 5 | **/bin/ 6 | **/obj/ 7 | Pulumi.*.yaml 8 | **/node_modules/ 9 | .DS_Store 10 | 11 | **/command-output/ 12 | 13 | .idea/ 14 | *.iml 15 | 16 | yarn.lock 17 | **/pulumiManifest.go 18 | 19 | ci-scripts 20 | provider/**/schema-embed.json 21 | **/version.txt 22 | **/nuget 23 | **/dist 24 | -------------------------------------------------------------------------------- /.golangci.yml: -------------------------------------------------------------------------------- 1 | linters: 2 | enable: 3 | - errcheck 4 | - goconst 5 | - gofmt 6 | - gosec 7 | - govet 8 | - ineffassign 9 | - lll 10 | - megacheck 11 | - misspell 12 | - nakedret 13 | - revive 14 | - unconvert 15 | - unused 16 | enable-all: false 17 | run: 18 | skip-files: 19 | - schema.go 20 | - pulumiManifest.go 21 | timeout: 20m 22 | -------------------------------------------------------------------------------- /.goreleaser.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | archives: 3 | - id: archive 4 | name_template: "{{ .Binary }}-{{ .Tag }}-{{ .Os }}-{{ .Arch }}" 5 | before: 6 | hooks: 7 | - make tfgen 8 | builds: 9 | - binary: pulumi-resource-onepassword 10 | dir: provider 11 | env: 12 | - CGO_ENABLED=0 13 | goarch: 14 | - amd64 15 | - arm64 16 | goos: 17 | - darwin 18 | - linux 19 | - windows 20 | ldflags: 21 | # Below line *must* align with the module in the provider/go.mod file. 22 | - -X github.com/1Password/pulumi-onepassword/provider/pkg/version.Version={{ .Tag }} 23 | main: ./cmd/pulumi-resource-onepassword/ 24 | changelog: 25 | disable: true 26 | release: 27 | disable: false 28 | prerelease: auto 29 | snapshot: 30 | version_template: "{{ .Tag }}-SNAPSHOT" 31 | -------------------------------------------------------------------------------- /.pulumi-java-gen.version: -------------------------------------------------------------------------------- 1 | 0.12.0 -------------------------------------------------------------------------------- /.upgrade-config.yml: -------------------------------------------------------------------------------- 1 | # Upstream provider links: 2 | # - GitHub repo: https://github.com/1Password/terraform-provider-onepassword 3 | # - Terraform registry: https://registry.terraform.io/providers/1Password/onepassword 4 | upstream-provider-name: terraform-provider-onepassword 5 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | CHANGELOG 2 | ========= 3 | 4 | ## HEAD (Unreleased) 5 | pulumi-package-publisher 6 | * Use [Pulumi Package Publisher Action](https://github.com/pulumi/pulumi-package-publisher) in release.yml template 7 | * fix dotnetversion typo in release template #94 8 | * fix `/usr/share/dotnet/host/xfr does not exist` issue when running `make build_dotnet` 9 | 10 | --- 11 | -------------------------------------------------------------------------------- /CODE-OF-CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to making participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, gender identity and expression, level of experience, 9 | education, socio-economic status, nationality, personal appearance, race, 10 | religion, or sexual identity and orientation. 11 | 12 | ## Our Standards 13 | 14 | Examples of behavior that contributes to creating a positive environment 15 | include: 16 | 17 | * Using welcoming and inclusive language 18 | * Being respectful of differing viewpoints and experiences 19 | * Gracefully accepting constructive criticism 20 | * Focusing on what is best for the community 21 | * Showing empathy towards other community members 22 | 23 | Examples of unacceptable behavior by participants include: 24 | 25 | * The use of sexualized language or imagery and unwelcome sexual attention or 26 | advances 27 | * Trolling, insulting/derogatory comments, and personal or political attacks 28 | * Public or private harassment 29 | * Publishing others' private information, such as a physical or electronic 30 | address, without explicit permission 31 | * Other conduct which could reasonably be considered inappropriate in a 32 | professional setting 33 | 34 | ## Our Responsibilities 35 | 36 | Project maintainers are responsible for clarifying the standards of acceptable 37 | behavior and are expected to take appropriate and fair corrective action in 38 | response to any instances of unacceptable behavior. 39 | 40 | Project maintainers have the right and responsibility to remove, edit, or 41 | reject comments, commits, code, wiki edits, issues, and other contributions 42 | that are not aligned to this Code of Conduct, or to ban temporarily or 43 | permanently any contributor for other behaviors that they deem inappropriate, 44 | threatening, offensive, or harmful. 45 | 46 | ## Scope 47 | 48 | This Code of Conduct applies both within project spaces and in public spaces 49 | when an individual is representing the project or its community. Examples of 50 | representing a project or community include using an official project e-mail 51 | address, posting via an official social media account, or acting as an appointed 52 | representative at an online or offline event. Representation of a project may be 53 | further defined and clarified by project maintainers. 54 | 55 | ## Enforcement 56 | 57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 58 | reported by contacting the project team at code-of-conduct@pulumi.com. All 59 | complaints will be reviewed and investigated and will result in a response that 60 | is deemed necessary and appropriate to the circumstances. The project team is 61 | obligated to maintain confidentiality with regard to the reporter of an incident. 62 | Further details of specific enforcement policies may be posted separately. 63 | 64 | Project maintainers who do not follow or enforce the Code of Conduct in good 65 | faith may face temporary or permanent repercussions as determined by other 66 | members of the project's leadership. 67 | 68 | ## Attribution 69 | 70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 71 | available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html 72 | 73 | [homepage]: https://www.contributor-covenant.org 74 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to the Pulumi ecosystem 2 | 3 | Do you want to contribute to Pulumi? Awesome! We are so happy to have you. 4 | We have a few tips and housekeeping items to help you get up and running. 5 | 6 | ## Code of Conduct 7 | 8 | Please make sure to read and observe our [Code of Conduct](./CODE-OF-CONDUCT.md) 9 | 10 | ## Community Expectations 11 | 12 | Please read about our [contribution guidelines here.](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md#communications) 13 | 14 | ## Setting up your development environment 15 | 16 | ### Pulumi prerequisites 17 | 18 | Please refer to the [main Pulumi repo](https://github.com/pulumi/pulumi/)'s [CONTRIBUTING.md file]( 19 | https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md#developing) for details on how to get set up with Pulumi. 20 | 21 | ## Committing Generated Code 22 | 23 | You must generate and check in the SDKs on each pull request containing a code change, e.g. adding a new resource to `resources.go`. 24 | 25 | 1. Run `make build_sdks` from the root of this repository 26 | 1. Open a pull request containing all changes 27 | 1. *Note:* If a large number of seemingly-unrelated diffs are produced by `make build_sdks` (for example, lots of changes to comments unrelated to the change you are making), ensure that the latest dependencies for the provider are installed by running `go mod tidy` in the `provider/` directory of this repository. 28 | 29 | ## Running Integration Tests 30 | 31 | The examples and integration tests in this repository will create and destroy real 32 | cloud resources while running. Before running these tests, make sure that you have 33 | configured access to your cloud provider with Pulumi. 34 | 35 | _TODO: Add any steps you need to take to run integration tests here_ 36 | 37 | -------------------------------------------------------------------------------- /COPYRIGHT: -------------------------------------------------------------------------------- 1 | Except as otherwise noted below and/or in individual files, this 2 | project is licensed under the Apache License, Version 2.0 (see 3 | LICENSE or ). 4 | 5 | This project is a larger work that combines with software written 6 | by third parties, licensed under their own terms. 7 | 8 | Notably, this larger work combines with the Terraform XYZ Provider, 9 | which is licensed under the Mozilla Public License 2.0 (see 10 | or the project itself at 11 | ). 12 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | PROJECT_NAME := onepassword Package 2 | 3 | SHELL := /bin/bash 4 | PACK := onepassword 5 | ORG := 1Password 6 | PROJECT := github.com/${ORG}/pulumi-${PACK} 7 | NODE_MODULE_NAME := @1password/pulumi-${PACK} 8 | TF_NAME := ${PACK} 9 | PROVIDER_PATH := provider 10 | VERSION_PATH := ${PROVIDER_PATH}/pkg/version.Version 11 | 12 | TFGEN := pulumi-tfgen-${PACK} 13 | PROVIDER := pulumi-resource-${PACK} 14 | VERSION := $(shell pulumictl get version) 15 | 16 | TESTPARALLELISM := 4 17 | 18 | WORKING_DIR := $(shell pwd) 19 | 20 | OS := $(shell uname) 21 | EMPTY_TO_AVOID_SED := "" 22 | 23 | prepare:: 24 | @if test -z "${NAME}"; then echo "NAME not set"; exit 1; fi 25 | @if test -z "${REPOSITORY}"; then echo "REPOSITORY not set"; exit 1; fi 26 | @if test ! -d "provider/cmd/pulumi-tfgen-x${EMPTY_TO_AVOID_SED}yz"; then "Project already prepared"; exit 1; fi 27 | 28 | mv "provider/cmd/pulumi-tfgen-x${EMPTY_TO_AVOID_SED}yz" provider/cmd/pulumi-tfgen-${NAME} 29 | mv "provider/cmd/pulumi-resource-x${EMPTY_TO_AVOID_SED}yz" provider/cmd/pulumi-resource-${NAME} 30 | 31 | if [[ "${OS}" != "Darwin" ]]; then \ 32 | sed -i 's,github.com/pulumi/pulumi-onepassword,${REPOSITORY},g' provider/go.mod; \ 33 | find ./ ! -path './.git/*' -type f -exec sed -i 's/[x]yz/${NAME}/g' {} \; &> /dev/null; \ 34 | fi 35 | 36 | # In MacOS the -i parameter needs an empty string to execute in place. 37 | if [[ "${OS}" == "Darwin" ]]; then \ 38 | sed -i '' 's,github.com/pulumi/pulumi-onepassword,${REPOSITORY},g' provider/go.mod; \ 39 | find ./ ! -path './.git/*' -type f -exec sed -i '' 's/[x]yz/${NAME}/g' {} \; &> /dev/null; \ 40 | fi 41 | 42 | .PHONY: development provider build_sdks build_nodejs build_dotnet build_go build_python cleanup 43 | 44 | development:: install_plugins provider lint_provider build_sdks install_sdks cleanup # Build the provider & SDKs for a development environment 45 | 46 | # Required for the codegen action that runs in pulumi/pulumi and pulumi/pulumi-terraform-bridge 47 | build:: install_plugins provider build_sdks install_sdks 48 | only_build:: build 49 | 50 | tfgen:: install_plugins 51 | (cd provider && go build -o $(WORKING_DIR)/bin/${TFGEN} -ldflags "-X ${PROJECT}/${VERSION_PATH}=${VERSION}" ${PROJECT}/${PROVIDER_PATH}/cmd/${TFGEN}) 52 | $(WORKING_DIR)/bin/${TFGEN} schema --out provider/cmd/${PROVIDER} 53 | (cd provider && VERSION=$(VERSION) go generate cmd/${PROVIDER}/main.go) 54 | 55 | provider:: tfgen install_plugins # build the provider binary 56 | (cd provider && go build -o $(WORKING_DIR)/bin/${PROVIDER} -ldflags "-X ${PROJECT}/${VERSION_PATH}=${VERSION}" ${PROJECT}/${PROVIDER_PATH}/cmd/${PROVIDER}) 57 | 58 | build_sdks:: install_plugins provider build_nodejs build_python build_go build_dotnet # build all the sdks 59 | 60 | build_nodejs:: VERSION := $(shell pulumictl get version --language javascript) 61 | build_nodejs:: install_plugins tfgen # build the node sdk 62 | $(WORKING_DIR)/bin/$(TFGEN) nodejs --overlays provider/overlays/nodejs --out sdk/nodejs/ 63 | cd sdk/nodejs/ && \ 64 | yarn install && \ 65 | yarn run tsc && \ 66 | cp ../../README.md ../../LICENSE package.json yarn.lock ./bin/ && \ 67 | sed -i.bak -e "s/\$${VERSION}/$(VERSION)/g" ./bin/package.json 68 | 69 | build_python:: PYPI_VERSION := $(shell pulumictl get version --language python) 70 | build_python:: install_plugins tfgen # build the python sdk 71 | $(WORKING_DIR)/bin/$(TFGEN) python --overlays provider/overlays/python --out sdk/python/ 72 | cd sdk/python/ && \ 73 | cp ../../README.md . && \ 74 | python3 setup.py clean --all 2>/dev/null && \ 75 | rm -rf ./bin/ ../python.bin/ && cp -R . ../python.bin && mv ../python.bin ./bin && \ 76 | sed -i.bak -e 's/^VERSION = .*/VERSION = "$(PYPI_VERSION)"/g' -e 's/^PLUGIN_VERSION = .*/PLUGIN_VERSION = "$(VERSION)"/g' ./bin/setup.py && \ 77 | rm ./bin/setup.py.bak && \ 78 | cd ./bin && python3 setup.py build sdist 79 | 80 | build_dotnet:: DOTNET_VERSION := $(shell pulumictl get version --language dotnet) 81 | build_dotnet:: install_plugins tfgen # build the dotnet sdk 82 | pulumictl get version --language dotnet 83 | $(WORKING_DIR)/bin/$(TFGEN) dotnet --overlays provider/overlays/dotnet --out sdk/dotnet/ 84 | cd sdk/dotnet/ && \ 85 | echo "${DOTNET_VERSION}" >version.txt && \ 86 | dotnet build /p:Version=${DOTNET_VERSION} 87 | 88 | build_go:: install_plugins tfgen # build the go sdk 89 | $(WORKING_DIR)/bin/$(TFGEN) go --overlays provider/overlays/go --out sdk/go/ 90 | 91 | lint_provider:: provider # lint the provider code 92 | cd provider && golangci-lint run -c ../.golangci.yml 93 | 94 | cleanup:: # cleans up the temporary directory 95 | rm -r $(WORKING_DIR)/bin 96 | rm -f provider/cmd/${PROVIDER}/schema.go 97 | 98 | help:: 99 | @grep '^[^.#]\+:\s\+.*#' Makefile | \ 100 | sed "s/\(.\+\):\s*\(.*\) #\s*\(.*\)/`printf "\033[93m"`\1`printf "\033[0m"` \3 [\2]/" | \ 101 | expand -t20 102 | 103 | clean:: 104 | rm -rf sdk/{dotnet,nodejs,go,python} 105 | 106 | install_plugins:: 107 | [ -x $(shell which pulumi) ] || curl -fsSL https://get.pulumi.com | sh 108 | pulumi plugin install resource random 4.3.1 109 | 110 | install_dotnet_sdk:: 111 | mkdir -p $(WORKING_DIR)/nuget 112 | find . -name '*.nupkg' -print -exec cp -p {} ${WORKING_DIR}/nuget \; 113 | 114 | install_python_sdk:: 115 | 116 | install_go_sdk:: 117 | 118 | install_nodejs_sdk:: 119 | yarn link --cwd $(WORKING_DIR)/sdk/nodejs/bin 120 | 121 | install_sdks:: install_dotnet_sdk install_python_sdk install_nodejs_sdk 122 | 123 | test:: 124 | cd examples && go test -v -tags=all -parallel ${TESTPARALLELISM} -timeout 2h 125 | 126 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 1Password Pulumi provider 2 | 3 | Use the 1Password Pulumi provider to access and manage items in your 1Password vaults. 4 | 5 | ## Installing 6 | 7 | This package is available for several languages/platforms: 8 | 9 | ### Node.js (JavaScript/TypeScript) 10 | 11 | To use from JavaScript or TypeScript in Node.js, install using either `npm`: 12 | 13 | ```bash 14 | npm install @1password/pulumi-onepassword 15 | ``` 16 | 17 | or `yarn`: 18 | 19 | ```bash 20 | yarn add @1password/pulumi-onepassword 21 | ``` 22 | 23 | ### Python 24 | 25 | To use from Python, install using `pip`: 26 | 27 | ```bash 28 | pip install pulumi_onepassword 29 | ``` 30 | 31 | ### Go 32 | 33 | To use from Go, use `go get` to grab the latest version of the library: 34 | 35 | 36 | 37 | 38 | ```bash 39 | go get github.com/1Password/pulumi-onepassword/sdk/go/... 40 | ``` 41 | 42 | 55 | 56 | ## Configuration 57 | 58 | The following configuration points are available for the `1Password` provider: 59 | 60 | - `pulumi-onepassword:url` (environment: `OP_CONNECT_HOST`) - the URL where your 1Password Connect API can be found 61 | - `pulumi-onepassword:token` (environment: `OP_CONNECT_TOKEN`) - the token for your Connect API. 62 | - `pulumi-onepassword:service_account_token` (environment: `OP_SERVICE_ACCOUNT_TOKEN`) - The 1Password service account token to use with 1Password CLI. 63 | - `pulumi-onepassword:account` (environment: `OP_ACCOUNT`) - A valid account's sign-in address or ID to use with 1Password CLI and biometric unlock. 64 | - `pulumi-onepassword:op_cli_path` (environment: `OP_CLI_PATH`) - The path to the 1Password CLI binary. 65 | 66 | ## Reference 67 | 68 | 69 | 70 | For detailed reference documentation, please visit [the Pulumi registry](https://www.pulumi.com/registry/packages/onepassword/). 71 | -------------------------------------------------------------------------------- /docs/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 1Password 3 | meta_desc: Provides an overview of the 1Password Provider for Pulumi. 4 | layout: package 5 | --- 6 | 7 | The 1Password provider for Pulumi allows you to access and manage items in your [1Password](https://1password.com) vaults. 8 | You'll need to configure the 1Password provider with credentials to access and manage items in 1Password. 9 | 10 | ## Example 11 | 12 | {{< chooser language "javascript,typescript,python,go" >}} 13 | 14 | {{% choosable language javascript %}} 15 | 16 | ```javascript 17 | const pulumi = require("@pulumi/pulumi"); 18 | const onepassword = require("@1password/pulumi-onepassword"); 19 | 20 | const example = onepassword.getItem({ 21 | vault: data.onepassword_vault.example.uuid, 22 | uuid: onepassword_item.demo_sections.uuid, 23 | }); 24 | ``` 25 | 26 | {{% /choosable %}} 27 | {{% choosable language typescript %}} 28 | 29 | ```typescript 30 | import * as pulumi from "@pulumi/pulumi"; 31 | import * as onepassword from "@1password/pulumi-onepassword"; 32 | 33 | const example = onepassword.getItem({ 34 | vault: data.onepassword_vault.example.uuid, 35 | uuid: onepassword_item.demo_sections.uuid, 36 | }); 37 | ``` 38 | 39 | {{% /choosable %}} 40 | {{% choosable language python %}} 41 | 42 | ```python 43 | import pulumi 44 | import pulumi_onepassword as onepassword 45 | 46 | example = onepassword.get_item(vault=data["onepassword_vault"]["example"]["uuid"], 47 | uuid=onepassword_item["demo_sections"]["uuid"]) 48 | ``` 49 | 50 | {{% /choosable %}} 51 | {{% choosable language go %}} 52 | 53 | ```go 54 | package main 55 | 56 | import ( 57 | 58 | "github.com/1Password/pulumi-onepassword/sdk/go/onepassword" 59 | "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 60 | 61 | ) 62 | 63 | func main() { 64 | pulumi.Run(func(ctx *pulumi.Context) error { 65 | _, err := onepassword.LookupItem(ctx, &onepassword.LookupItemArgs{ 66 | Vault: data.Onepassword_vault.Example.Uuid, 67 | Uuid: pulumi.StringRef(onepassword_item.Demo_sections.Uuid), 68 | }, nil) 69 | if err != nil { 70 | return err 71 | } 72 | return nil 73 | }) 74 | } 75 | ``` 76 | 77 | {{% /choosable %}} 78 | 79 | 103 | 104 | {{< /chooser >}} 105 | -------------------------------------------------------------------------------- /docs/installation-configuration.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 1Password Provider Installation & Configuration 3 | meta_desc: Provides an overview on how to configure credentials for the 1Password provider for Pulumi. 4 | layout: package 5 | --- 6 | 7 | The 1Password provider for Pulumi allows you to access and manage items in your 1Password vaults using Pulumi. 8 | 9 | ## Installation 10 | 11 | The 1Password provider for Pulumi is available as a package in most Pulumi languages: 12 | 13 | - JavaScript/TypeScript: [@1password/pulumi-onepassword](https://www.npmjs.com/package/@1password/pulumi-onepassword) 14 | - Python: [pulumi_onepassword](https://pypi.org/project/pulumi-onepassword/) 15 | - Go: [github.com/1Password/pulumi-onepassword/sdk/go/onepassword](https://pkg.go.dev/github.com/1Password/pulumi-onepassword/sdk/go/onepassword) 16 | - .NET: _coming soon_ 17 | 18 | ### Provider Binary 19 | 20 | The 1Password provider binary is a third party binary. It can be installed using the `pulumi plugin` command. 21 | 22 | ```sh 23 | pulumi plugin install resource onepassword --server github://api.github.com/1Password/pulumi-onepassword 24 | ``` 25 | 26 | Replace the version string with your desired version. 27 | 28 | ## Configuration 29 | 30 | You must configure the 1Password provider for Pulumi with your 1Password credentials before the provider can be used to access and manage items in your 1Password vaults. You can use one of the following: 31 | 32 | - [Service account](https://developer.1password.com/docs/service-accounts/get-started) 33 | - `pulumi-onepassword:service_account_token` (environment: `OP_SERVICE_ACCOUNT_TOKEN`) - the 1Password service account token. Requires [1Password CLI](https://developer.1password.com/docs/cli/get-started/). 34 | - [Connect server](https://developer.1password.com/docs/connect/get-started) 35 | - `pulumi-onepassword:url` (environment: `OP_CONNECT_HOST`) - the URL where your 1Password Connect API can be found. 36 | - `pulumi-onepassword:token` (environment: `OP_CONNECT_TOKEN`) - the token for your Connect API. 37 | - Personal account 38 | - `pulumi-onepassword:account` (environment: `OP_ACCOUNT`) - the [sign-in address](https://support.1password.com/1password-glossary/#sign-in-address) or [unique identifier](https://developer.1password.com/docs/cli/reference/#unique-identifiers-ids) for your 1Password account. Requires [1Password CLI](https://developer.1password.com/docs/cli/get-started/) and biometric unlock. 39 | 40 | After you find your credentials, there are two ways to provide them to Pulumi: 41 | 42 | 1. Set the environment variables for the preferred method. For example, to set the environment variable for a service account token: 43 | 44 | ```sh 45 | $ export OP_SERVICE_ACCOUNT_TOKEN=XXXXXXXXXXXXXX 46 | ``` 47 | 48 | 2. If you prefer to store your credentials alongside your Pulumi stack for easy multi-user access, use configuration to set them. 49 | 50 | ```sh 51 | $ pulumi config set pulumi-onepassword:service_account_token --secret 52 | Value: 53 | ``` 54 | 55 | Make sure to pass `--secret` when setting any sensitive data (in this example `pulumi-onepassword:service_account_token`) so that it's properly encrypted. The complete list of configuration parameters is in the [1Password provider for Pulumi README](https://github.com/1Password/pulumi-onepassword/blob/main/README.md#configuration). 56 | -------------------------------------------------------------------------------- /examples/.gitignore: -------------------------------------------------------------------------------- 1 | .pulumi/ 2 | **/bin/ 3 | node_modules/ 4 | 5 | -------------------------------------------------------------------------------- /examples/examples_nodejs_test.go: -------------------------------------------------------------------------------- 1 | //go:build nodejs || all 2 | // +build nodejs all 3 | 4 | package examples 5 | 6 | import ( 7 | "os" 8 | "path/filepath" 9 | "testing" 10 | 11 | "github.com/pulumi/pulumi/pkg/v3/testing/integration" 12 | ) 13 | 14 | func getJSBaseOptions(t *testing.T) integration.ProgramTestOptions { 15 | base := getBaseOptions() 16 | baseJS := base.With(integration.ProgramTestOptions{ 17 | Dependencies: []string{ 18 | "@1password/pulumi-onepassword", 19 | }, 20 | }) 21 | 22 | return baseJS 23 | } 24 | 25 | func TestProviderTs(t *testing.T) { 26 | itemUUID := os.Getenv("OP_ITEM_UUID") 27 | vaultUUID := os.Getenv("OP_VAULT_UUID") 28 | 29 | test := getJSBaseOptions(t). 30 | With(integration.ProgramTestOptions{ 31 | Dir: filepath.Join(getCwd(t), "provider-example", "ts"), 32 | Config: map[string]string { 33 | "OP_ITEM_UUID": itemUUID, 34 | "OP_VAULT_UUID": vaultUUID, 35 | }, 36 | }) 37 | integration.ProgramTest(t, &test) 38 | } 39 | -------------------------------------------------------------------------------- /examples/examples_py_test.go: -------------------------------------------------------------------------------- 1 | //go:build python || all 2 | // +build python all 3 | 4 | package examples 5 | 6 | import ( 7 | "path/filepath" 8 | "testing" 9 | 10 | "github.com/pulumi/pulumi/pkg/v3/testing/integration" 11 | ) 12 | 13 | func getPythonBaseOptions(t *testing.T) integration.ProgramTestOptions { 14 | base := getBaseOptions() 15 | basePython := base.With(integration.ProgramTestOptions{ 16 | Dependencies: []string{ 17 | filepath.Join("..", "sdk", "python", "bin"), 18 | }, 19 | }) 20 | 21 | return basePython 22 | } 23 | -------------------------------------------------------------------------------- /examples/examples_test.go: -------------------------------------------------------------------------------- 1 | package examples 2 | 3 | import ( 4 | "os" 5 | "testing" 6 | 7 | "github.com/pulumi/pulumi/pkg/v3/testing/integration" 8 | ) 9 | 10 | func getCwd(t *testing.T) string { 11 | cwd, err := os.Getwd() 12 | if err != nil { 13 | t.FailNow() 14 | } 15 | 16 | return cwd 17 | } 18 | 19 | func getBaseOptions() integration.ProgramTestOptions { 20 | return integration.ProgramTestOptions{ 21 | RunUpdateTest: false, 22 | ExpectRefreshChanges: true, 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /examples/provider-example/ts/.gitignore: -------------------------------------------------------------------------------- 1 | /bin/ 2 | /node_modules/ 3 | package-lock.json -------------------------------------------------------------------------------- /examples/provider-example/ts/Pulumi.yaml: -------------------------------------------------------------------------------- 1 | name: ts 2 | runtime: nodejs 3 | description: A minimal TypeScript Pulumi program 4 | config: 5 | pulumi:tags: 6 | value: 7 | pulumi:template: typescript 8 | -------------------------------------------------------------------------------- /examples/provider-example/ts/index.ts: -------------------------------------------------------------------------------- 1 | import * as pulumi from "@pulumi/pulumi"; 2 | import * as onepassword from "@1password/pulumi-onepassword"; 3 | 4 | const config = new pulumi.Config(); 5 | const itemUuid = config.require("OP_ITEM_UUID"); 6 | const vaultUuid = config.require("OP_VAULT_UUID"); 7 | 8 | // Fetching login details 9 | onepassword 10 | .getItem({ 11 | uuid: itemUuid, 12 | vault: vaultUuid, 13 | }) 14 | .then((c) => { 15 | pulumi.log.info(c.password); 16 | }); 17 | -------------------------------------------------------------------------------- /examples/provider-example/ts/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ts", 3 | "main": "index.ts", 4 | "devDependencies": { 5 | "@types/node": "^18" 6 | }, 7 | "dependencies": { 8 | "@pulumi/pulumi": "^3.0.0" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/provider-example/ts/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "strict": true, 4 | "outDir": "bin", 5 | "target": "es2016", 6 | "module": "commonjs", 7 | "moduleResolution": "node", 8 | "sourceMap": true, 9 | "experimentalDecorators": true, 10 | "pretty": true, 11 | "noFallthroughCasesInSwitch": true, 12 | "noImplicitReturns": true, 13 | "forceConsistentCasingInFileNames": true 14 | }, 15 | "files": [ 16 | "index.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /go.work: -------------------------------------------------------------------------------- 1 | go 1.21.12 2 | 3 | toolchain go1.23.0 4 | 5 | use ( 6 | ./examples 7 | ./provider 8 | ./sdk 9 | ) 10 | -------------------------------------------------------------------------------- /provider/cmd/pulumi-resource-onepassword/.gitignore: -------------------------------------------------------------------------------- 1 | schema.go 2 | -------------------------------------------------------------------------------- /provider/cmd/pulumi-resource-onepassword/Pulumi.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1Password/pulumi-onepassword/559bf4f66874e6ac6875fdb08cfe71ab0b98b273/provider/cmd/pulumi-resource-onepassword/Pulumi.yaml -------------------------------------------------------------------------------- /provider/cmd/pulumi-resource-onepassword/bridge-metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "auto-aliasing": { 3 | "resources": { 4 | "onepassword_item": { 5 | "current": "onepassword:index/item:Item", 6 | "majorVersion": 1, 7 | "fields": { 8 | "password_recipe": { 9 | "maxItemsOne": true 10 | }, 11 | "section": { 12 | "maxItemsOne": false, 13 | "elem": { 14 | "fields": { 15 | "field": { 16 | "maxItemsOne": false, 17 | "elem": { 18 | "fields": { 19 | "password_recipe": { 20 | "maxItemsOne": true 21 | } 22 | } 23 | } 24 | } 25 | } 26 | } 27 | }, 28 | "tags": { 29 | "maxItemsOne": false 30 | } 31 | } 32 | } 33 | }, 34 | "datasources": { 35 | "onepassword_item": { 36 | "current": "onepassword:index/getItem:getItem", 37 | "majorVersion": 1, 38 | "fields": { 39 | "file": { 40 | "maxItemsOne": false 41 | }, 42 | "section": { 43 | "maxItemsOne": false, 44 | "elem": { 45 | "fields": { 46 | "field": { 47 | "maxItemsOne": false 48 | }, 49 | "file": { 50 | "maxItemsOne": false 51 | } 52 | } 53 | } 54 | }, 55 | "tags": { 56 | "maxItemsOne": false 57 | } 58 | } 59 | }, 60 | "onepassword_vault": { 61 | "current": "onepassword:index/getVault:getVault", 62 | "majorVersion": 1 63 | } 64 | } 65 | }, 66 | "auto-settings": {}, 67 | "renames": { 68 | "resources": { 69 | "onepassword:index/item:Item": "onepassword_item" 70 | }, 71 | "functions": { 72 | "onepassword:index/getItem:getItem": "onepassword_item", 73 | "onepassword:index/getVault:getVault": "onepassword_vault" 74 | }, 75 | "renamedProperties": { 76 | "onepassword:index/ItemSection:ItemSection": { 77 | "fields": "field" 78 | }, 79 | "onepassword:index/ItemSectionField:ItemSectionField": { 80 | "passwordRecipe": "password_recipe" 81 | }, 82 | "onepassword:index/getItem:getItem": { 83 | "noteValue": "note_value", 84 | "sections": "section" 85 | }, 86 | "onepassword:index/getItemSection:getItemSection": { 87 | "fields": "field" 88 | }, 89 | "onepassword:index/item:Item": { 90 | "passwordRecipe": "password_recipe", 91 | "sections": "section" 92 | }, 93 | "onepassword:index:Provider": { 94 | "opCliPath": "op_cli_path", 95 | "serviceAccountToken": "service_account_token" 96 | } 97 | }, 98 | "renamedConfigProperties": { 99 | "opCliPath": "op_cli_path", 100 | "serviceAccountToken": "service_account_token" 101 | } 102 | } 103 | } -------------------------------------------------------------------------------- /provider/cmd/pulumi-resource-onepassword/generate.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016-2020, Pulumi Corporation. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | //go:build ignore 16 | 17 | package main 18 | 19 | import ( 20 | "encoding/json" 21 | "errors" 22 | "io/fs" 23 | "io/ioutil" 24 | "log" 25 | "os" 26 | 27 | "github.com/pulumi/pulumi/pkg/v3/codegen/schema" 28 | ) 29 | 30 | func main() { 31 | version, found := os.LookupEnv("VERSION") 32 | if !found { 33 | log.Fatal("version not found") 34 | } 35 | 36 | schemaContents, err := ioutil.ReadFile("./schema.json") 37 | if err != nil { 38 | log.Fatal(err) 39 | } 40 | 41 | var packageSpec schema.PackageSpec 42 | err = json.Unmarshal(schemaContents, &packageSpec) 43 | if err != nil { 44 | log.Fatalf("cannot deserialize schema: %v", err) 45 | } 46 | 47 | packageSpec.Version = version 48 | versionedContents, err := json.Marshal(packageSpec) 49 | if err != nil { 50 | log.Fatalf("cannot reserialize schema: %v", err) 51 | } 52 | 53 | // Clean up schema.go as it may be present & gitignored and tolerate an error if the file isn't present. 54 | err = os.Remove("./schema.go") 55 | if err != nil && !errors.Is(err, fs.ErrNotExist) { 56 | log.Fatal(err) 57 | } 58 | 59 | err = ioutil.WriteFile("./schema-embed.json", versionedContents, 0600) 60 | if err != nil { 61 | log.Fatal(err) 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /provider/cmd/pulumi-resource-onepassword/main.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016-2018, Pulumi Corporation. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | //go:generate go run ./generate.go 16 | 17 | package main 18 | 19 | import ( 20 | "context" 21 | _ "embed" 22 | 23 | onepassword "github.com/1Password/pulumi-onepassword/provider" 24 | "github.com/pulumi/pulumi-terraform-bridge/pf/tfbridge" 25 | ) 26 | 27 | //go:embed schema-embed.json 28 | var pulumiSchema []byte 29 | 30 | func main() { 31 | meta := tfbridge.ProviderMetadata{PackageSchema: pulumiSchema} 32 | // Modify the path to point to the new provider 33 | tfbridge.Main(context.Background(), "onepassword", onepassword.Provider(), meta) 34 | } 35 | -------------------------------------------------------------------------------- /provider/cmd/pulumi-tfgen-onepassword/main.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016-2018, Pulumi Corporation. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package main 16 | 17 | import ( 18 | onepassword "github.com/1Password/pulumi-onepassword/provider" 19 | "github.com/pulumi/pulumi-terraform-bridge/pf/tfgen" 20 | ) 21 | 22 | func main() { 23 | // Modify the path to point to the new provider 24 | tfgen.Main("onepassword", onepassword.Provider()) 25 | } 26 | -------------------------------------------------------------------------------- /provider/pkg/version/version.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016-2018, Pulumi Corporation. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package version 16 | 17 | // Version is initialized by the Go linker to contain the semver of this build. 18 | var Version string 19 | -------------------------------------------------------------------------------- /provider/resources.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016-2023, Pulumi Corporation. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package onepassword 16 | 17 | import ( 18 | "fmt" 19 | "path" 20 | 21 | // Allow embedding bridge-metadata.json in the provider. 22 | _ "embed" 23 | 24 | pf "github.com/pulumi/pulumi-terraform-bridge/pf/tfbridge" 25 | "github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge" 26 | "github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge/tokens" 27 | shim "github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfshim" 28 | "github.com/pulumi/pulumi/sdk/v3/go/common/resource" 29 | 30 | "github.com/1Password/pulumi-onepassword/provider/pkg/version" 31 | onepassword "github.com/1Password/terraform-provider-onepassword/v2/providerlink" 32 | ) 33 | 34 | // all of the token components used below. 35 | const ( 36 | // This variable controls the default name of the package in the package 37 | // registries for nodejs and python: 38 | mainPkg = "onepassword" 39 | // modules: 40 | mainMod = "index" // the onepassword module 41 | ) 42 | 43 | // preConfigureCallback is called before the providerConfigure function of the underlying provider. 44 | // It should validate that the provider can be configured, and provide actionable errors in the case 45 | // it cannot be. Configuration variables can be read from `vars` using the `stringValue` function - 46 | // for example `stringValue(vars, "accessKey")`. 47 | func preConfigureCallback(resource.PropertyMap, shim.ResourceConfig) error { 48 | return nil 49 | } 50 | 51 | //go:embed cmd/pulumi-resource-onepassword/bridge-metadata.json 52 | var metadata []byte 53 | 54 | // Provider returns additional overlaid schema and metadata associated with the provider.. 55 | func Provider() tfbridge.ProviderInfo { 56 | // Create a Pulumi provider mapping 57 | prov := tfbridge.ProviderInfo{ 58 | // Instantiate the Terraform provider 59 | P: pf.ShimProvider(onepassword.New(version.Version)()), 60 | Name: "onepassword", 61 | TFProviderModuleVersion: "v2", 62 | // DisplayName is a way to be able to change the casing of the provider 63 | // name when being displayed on the Pulumi registry 64 | DisplayName: "1Password", 65 | // The default publisher for all packages is Pulumi. 66 | // Change this to your personal name (or a company name) that you 67 | // would like to be shown in the Pulumi Registry if this package is published 68 | // there. 69 | Publisher: "1Password", 70 | // LogoURL is optional but useful to help identify your package in the Pulumi Registry 71 | // if this package is published there. 72 | // 73 | // You may host a logo on a domain you control or add an SVG logo for your package 74 | // in your repository and use the raw content URL for that file as your logo URL. 75 | LogoURL: "https://1password.com/logo-images/1password-logo-dark@2x.png", 76 | // PluginDownloadURL is an optional URL used to download the Provider 77 | // for use in Pulumi programs 78 | // e.g github://api.github.com/org/pulumi-provider-name 79 | PluginDownloadURL: "github://api.github.com/1Password/pulumi-onepassword", 80 | Description: "Use the 1Password Pulumi provider to access and manage items in your 1Password vaults.", 81 | // category/cloud tag helps with categorizing the package in the Pulumi Registry. 82 | // For all available categories, see `Keywords` in 83 | // https://www.pulumi.com/docs/guides/pulumi-packages/schema/#package. 84 | Keywords: []string{"pulumi", "onepassword", "1Password", "category/cloud"}, 85 | License: "Apache-2.0", 86 | Homepage: "https://www.developer.1password.com", 87 | Repository: "https://github.com/1Password/pulumi-onepassword", 88 | // The GitHub Org for the provider - defaults to `terraform-providers`. Note that this 89 | // should match the TF provider module's require directive, not any replace directives. 90 | GitHubOrg: "1Password", 91 | Version: version.Version, 92 | MetadataInfo: tfbridge.NewProviderMetadata(metadata), 93 | // Map the environment variables used in the 1Password Terraform provider schema 94 | // (see link below) to the Pulumi provider configuration. 95 | // https://github.com/1Password/terraform-provider-onepassword/blob/main/onepassword/provider.go#L40-L71 96 | Config: map[string]*tfbridge.SchemaInfo{ 97 | "url": { 98 | Default: &tfbridge.DefaultInfo{ 99 | EnvVars: []string{"OP_CONNECT_HOST"}, 100 | }, 101 | }, 102 | "token": { 103 | Default: &tfbridge.DefaultInfo{ 104 | EnvVars: []string{"OP_CONNECT_TOKEN"}, 105 | }, 106 | }, 107 | "service_account_token": { 108 | Default: &tfbridge.DefaultInfo{ 109 | EnvVars: []string{"OP_SERVICE_ACCOUNT_TOKEN"}, 110 | }, 111 | }, 112 | "account": { 113 | Default: &tfbridge.DefaultInfo{ 114 | EnvVars: []string{"OP_ACCOUNT"}, 115 | }, 116 | }, 117 | "op_cli_path": { 118 | Default: &tfbridge.DefaultInfo{ 119 | EnvVars: []string{"OP_CLI_PATH"}, 120 | }, 121 | }, 122 | }, 123 | PreConfigureCallback: preConfigureCallback, 124 | Resources: map[string]*tfbridge.ResourceInfo{ 125 | // Excerpt from https://github.com/pulumi/pulumi-tf-provider-boilerplate 126 | // > The name of the provider is omitted from the mapped name due to 127 | // > the presence of namespaces in all supported Pulumi languages. 128 | "onepassword_item": {Tok: tfbridge.MakeResource(mainPkg, mainMod, "Item")}, 129 | }, 130 | DataSources: map[string]*tfbridge.DataSourceInfo{ 131 | // Excerpt from https://github.com/pulumi/pulumi-tf-provider-boilerplate 132 | // > Note the 'get' prefix for data sources. 133 | "onepassword_vault": {Tok: tfbridge.MakeDataSource(mainPkg, mainMod, "getVault")}, 134 | "onepassword_item": {Tok: tfbridge.MakeDataSource(mainPkg, mainMod, "getItem")}, 135 | }, 136 | JavaScript: &tfbridge.JavaScriptInfo{ 137 | PackageName: "@1password/pulumi-onepassword", 138 | // List any npm dependencies and their versions 139 | Dependencies: map[string]string{ 140 | "@pulumi/pulumi": "^3.0.0", 141 | }, 142 | DevDependencies: map[string]string{ 143 | "@types/node": "^10.0.0", // so we can access strongly typed node definitions. 144 | "@types/mime": "^2.0.0", 145 | }, 146 | // See the documentation for tfbridge.OverlayInfo for how to lay out this 147 | // section, or refer to the AWS provider. Delete this section if there are 148 | // no overlay files. 149 | //Overlay: &tfbridge.OverlayInfo{}, 150 | }, 151 | Python: &tfbridge.PythonInfo{ 152 | PackageName: "pulumi_onepassword", 153 | // List any Python dependencies and their version ranges 154 | Requires: map[string]string{ 155 | "pulumi": ">=3.0.0,<4.0.0", 156 | }, 157 | }, 158 | Golang: &tfbridge.GolangInfo{ 159 | ImportBasePath: path.Join( 160 | fmt.Sprintf("github.com/1Password/pulumi-%[1]s/sdk/", mainPkg), 161 | tfbridge.GetModuleMajorVersion(version.Version), 162 | "go", 163 | mainPkg, 164 | ), 165 | GenerateResourceContainerTypes: true, 166 | }, 167 | CSharp: &tfbridge.CSharpInfo{ 168 | PackageReferences: map[string]string{ 169 | "Pulumi": "3.*", 170 | }, 171 | }, 172 | } 173 | 174 | // These are new API's that you may opt to use to automatically compute resource 175 | // tokens, and apply auto aliasing for full backwards compatibility. For more 176 | // information, please reference: 177 | // https://pkg.go.dev/github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge#ProviderInfo.ComputeTokens 178 | prov.MustComputeTokens(tokens.SingleModule("onepassword_", mainMod, 179 | tokens.MakeStandard(mainPkg))) 180 | prov.MustApplyAutoAliases() 181 | prov.SetAutonaming(255, "-") 182 | 183 | return prov 184 | } 185 | -------------------------------------------------------------------------------- /sdk/.gitignore: -------------------------------------------------------------------------------- 1 | /nodejs/bin/ 2 | /nodejs/node_modules/ 3 | /python/bin/ 4 | -------------------------------------------------------------------------------- /sdk/dotnet/Config/Config.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Immutable; 6 | 7 | namespace Pulumi.Onepassword 8 | { 9 | public static class Config 10 | { 11 | [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "IDE1006", Justification = 12 | "Double underscore prefix used to avoid conflicts with variable names.")] 13 | private sealed class __Value 14 | { 15 | private readonly Func _getter; 16 | private T _value = default!; 17 | private bool _set; 18 | 19 | public __Value(Func getter) 20 | { 21 | _getter = getter; 22 | } 23 | 24 | public T Get() => _set ? _value : _getter(); 25 | 26 | public void Set(T value) 27 | { 28 | _value = value; 29 | _set = true; 30 | } 31 | } 32 | 33 | private static readonly global::Pulumi.Config __config = new global::Pulumi.Config("onepassword"); 34 | 35 | private static readonly __Value _account = new __Value(() => __config.Get("account") ?? Utilities.GetEnv("OP_ACCOUNT")); 36 | /// 37 | /// A valid account's sign-in address or ID to use biometrics unlock. Can also be sourced from `OP_ACCOUNT` environment 38 | /// variable. Provider will use the 1Password CLI if set. 39 | /// 40 | public static string? Account 41 | { 42 | get => _account.Get(); 43 | set => _account.Set(value); 44 | } 45 | 46 | private static readonly __Value _opCliPath = new __Value(() => __config.Get("opCliPath") ?? Utilities.GetEnv("OP_CLI_PATH")); 47 | /// 48 | /// The path to the 1Password CLI binary. Can also be sourced from `OP_CLI_PATH` environment variable. Defaults to `op`. 49 | /// 50 | public static string? OpCliPath 51 | { 52 | get => _opCliPath.Get(); 53 | set => _opCliPath.Set(value); 54 | } 55 | 56 | private static readonly __Value _serviceAccountToken = new __Value(() => __config.Get("serviceAccountToken") ?? Utilities.GetEnv("OP_SERVICE_ACCOUNT_TOKEN")); 57 | /// 58 | /// A valid 1Password service account token. Can also be sourced from `OP_SERVICE_ACCOUNT_TOKEN` environment variable. 59 | /// Provider will use the 1Password CLI if set. 60 | /// 61 | public static string? ServiceAccountToken 62 | { 63 | get => _serviceAccountToken.Get(); 64 | set => _serviceAccountToken.Set(value); 65 | } 66 | 67 | private static readonly __Value _token = new __Value(() => __config.Get("token") ?? Utilities.GetEnv("OP_CONNECT_TOKEN")); 68 | /// 69 | /// A valid token for your 1Password Connect server. Can also be sourced from `OP_CONNECT_TOKEN` environment variable. 70 | /// Provider will use 1Password Connect server if set. 71 | /// 72 | public static string? Token 73 | { 74 | get => _token.Get(); 75 | set => _token.Set(value); 76 | } 77 | 78 | private static readonly __Value _url = new __Value(() => __config.Get("url") ?? Utilities.GetEnv("OP_CONNECT_HOST")); 79 | /// 80 | /// The HTTP(S) URL where your 1Password Connect server can be found. Can also be sourced `OP_CONNECT_HOST` environment 81 | /// variable. Provider will use 1Password Connect server if set. 82 | /// 83 | public static string? Url 84 | { 85 | get => _url.Get(); 86 | set => _url.Set(value); 87 | } 88 | 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /sdk/dotnet/Config/README.md: -------------------------------------------------------------------------------- 1 | Use the 1Password Pulumi provider to access and manage items in your 1Password vaults. 2 | -------------------------------------------------------------------------------- /sdk/dotnet/GetVault.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.Onepassword 11 | { 12 | public static class GetVault 13 | { 14 | /// 15 | /// Use this data source to get details of a vault by either its name or uuid. 16 | /// 17 | /// ## Example Usage 18 | /// 19 | /// ```csharp 20 | /// using System.Collections.Generic; 21 | /// using System.Linq; 22 | /// using Pulumi; 23 | /// using Onepassword = Pulumi.Onepassword; 24 | /// 25 | /// return await Deployment.RunAsync(() => 26 | /// { 27 | /// var example = Onepassword.GetVault.Invoke(new() 28 | /// { 29 | /// Name = "your-vault-name", 30 | /// }); 31 | /// 32 | /// }); 33 | /// ``` 34 | /// 35 | public static Task InvokeAsync(GetVaultArgs? args = null, InvokeOptions? options = null) 36 | => global::Pulumi.Deployment.Instance.InvokeAsync("onepassword:index/getVault:getVault", args ?? new GetVaultArgs(), options.WithDefaults()); 37 | 38 | /// 39 | /// Use this data source to get details of a vault by either its name or uuid. 40 | /// 41 | /// ## Example Usage 42 | /// 43 | /// ```csharp 44 | /// using System.Collections.Generic; 45 | /// using System.Linq; 46 | /// using Pulumi; 47 | /// using Onepassword = Pulumi.Onepassword; 48 | /// 49 | /// return await Deployment.RunAsync(() => 50 | /// { 51 | /// var example = Onepassword.GetVault.Invoke(new() 52 | /// { 53 | /// Name = "your-vault-name", 54 | /// }); 55 | /// 56 | /// }); 57 | /// ``` 58 | /// 59 | public static Output Invoke(GetVaultInvokeArgs? args = null, InvokeOptions? options = null) 60 | => global::Pulumi.Deployment.Instance.Invoke("onepassword:index/getVault:getVault", args ?? new GetVaultInvokeArgs(), options.WithDefaults()); 61 | } 62 | 63 | 64 | public sealed class GetVaultArgs : global::Pulumi.InvokeArgs 65 | { 66 | /// 67 | /// The name of the vault to retrieve. This field will be populated with the name of the vault if the vault it looked up by its UUID. 68 | /// 69 | [Input("name")] 70 | public string? Name { get; set; } 71 | 72 | /// 73 | /// The UUID of the vault to retrieve. This field will be populated with the UUID of the vault if the vault it looked up by its name. 74 | /// 75 | [Input("uuid")] 76 | public string? Uuid { get; set; } 77 | 78 | public GetVaultArgs() 79 | { 80 | } 81 | public static new GetVaultArgs Empty => new GetVaultArgs(); 82 | } 83 | 84 | public sealed class GetVaultInvokeArgs : global::Pulumi.InvokeArgs 85 | { 86 | /// 87 | /// The name of the vault to retrieve. This field will be populated with the name of the vault if the vault it looked up by its UUID. 88 | /// 89 | [Input("name")] 90 | public Input? Name { get; set; } 91 | 92 | /// 93 | /// The UUID of the vault to retrieve. This field will be populated with the UUID of the vault if the vault it looked up by its name. 94 | /// 95 | [Input("uuid")] 96 | public Input? Uuid { get; set; } 97 | 98 | public GetVaultInvokeArgs() 99 | { 100 | } 101 | public static new GetVaultInvokeArgs Empty => new GetVaultInvokeArgs(); 102 | } 103 | 104 | 105 | [OutputType] 106 | public sealed class GetVaultResult 107 | { 108 | /// 109 | /// The description of the vault. 110 | /// 111 | public readonly string Description; 112 | public readonly string Id; 113 | /// 114 | /// The name of the vault to retrieve. This field will be populated with the name of the vault if the vault it looked up by its UUID. 115 | /// 116 | public readonly string Name; 117 | /// 118 | /// The UUID of the vault to retrieve. This field will be populated with the UUID of the vault if the vault it looked up by its name. 119 | /// 120 | public readonly string Uuid; 121 | 122 | [OutputConstructor] 123 | private GetVaultResult( 124 | string description, 125 | 126 | string id, 127 | 128 | string name, 129 | 130 | string uuid) 131 | { 132 | Description = description; 133 | Id = id; 134 | Name = name; 135 | Uuid = uuid; 136 | } 137 | } 138 | } 139 | -------------------------------------------------------------------------------- /sdk/dotnet/Inputs/GetItemFile.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.Onepassword.Inputs 11 | { 12 | 13 | public sealed class GetItemFileArgs : global::Pulumi.InvokeArgs 14 | { 15 | [Input("content", required: true)] 16 | private string? _content; 17 | 18 | /// 19 | /// The content of the file. 20 | /// 21 | public string? Content 22 | { 23 | get => _content; 24 | set => _content = value; 25 | } 26 | 27 | [Input("contentBase64", required: true)] 28 | private string? _contentBase64; 29 | 30 | /// 31 | /// The content of the file in base64 encoding. (Use this for binary files.) 32 | /// 33 | public string? ContentBase64 34 | { 35 | get => _contentBase64; 36 | set => _contentBase64 = value; 37 | } 38 | 39 | /// 40 | /// The UUID of the file. 41 | /// 42 | [Input("id", required: true)] 43 | public string Id { get; set; } = null!; 44 | 45 | /// 46 | /// The name of the file. 47 | /// 48 | [Input("name", required: true)] 49 | public string Name { get; set; } = null!; 50 | 51 | public GetItemFileArgs() 52 | { 53 | } 54 | public static new GetItemFileArgs Empty => new GetItemFileArgs(); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /sdk/dotnet/Inputs/GetItemFileArgs.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.Onepassword.Inputs 11 | { 12 | 13 | public sealed class GetItemFileInputArgs : global::Pulumi.ResourceArgs 14 | { 15 | [Input("content", required: true)] 16 | private Input? _content; 17 | 18 | /// 19 | /// The content of the file. 20 | /// 21 | public Input? Content 22 | { 23 | get => _content; 24 | set 25 | { 26 | var emptySecret = Output.CreateSecret(0); 27 | _content = Output.Tuple?, int>(value, emptySecret).Apply(t => t.Item1); 28 | } 29 | } 30 | 31 | [Input("contentBase64", required: true)] 32 | private Input? _contentBase64; 33 | 34 | /// 35 | /// The content of the file in base64 encoding. (Use this for binary files.) 36 | /// 37 | public Input? ContentBase64 38 | { 39 | get => _contentBase64; 40 | set 41 | { 42 | var emptySecret = Output.CreateSecret(0); 43 | _contentBase64 = Output.Tuple?, int>(value, emptySecret).Apply(t => t.Item1); 44 | } 45 | } 46 | 47 | /// 48 | /// The UUID of the file. 49 | /// 50 | [Input("id", required: true)] 51 | public Input Id { get; set; } = null!; 52 | 53 | /// 54 | /// The name of the file. 55 | /// 56 | [Input("name", required: true)] 57 | public Input Name { get; set; } = null!; 58 | 59 | public GetItemFileInputArgs() 60 | { 61 | } 62 | public static new GetItemFileInputArgs Empty => new GetItemFileInputArgs(); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /sdk/dotnet/Inputs/GetItemSection.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.Onepassword.Inputs 11 | { 12 | 13 | public sealed class GetItemSectionArgs : global::Pulumi.InvokeArgs 14 | { 15 | [Input("fields")] 16 | private List? _fields; 17 | public List Fields 18 | { 19 | get => _fields ?? (_fields = new List()); 20 | set => _fields = value; 21 | } 22 | 23 | [Input("files")] 24 | private List? _files; 25 | 26 | /// 27 | /// A list of files attached to the section. 28 | /// 29 | public List Files 30 | { 31 | get => _files ?? (_files = new List()); 32 | set => _files = value; 33 | } 34 | 35 | /// 36 | /// A unique identifier for the section. 37 | /// 38 | [Input("id", required: true)] 39 | public string Id { get; set; } = null!; 40 | 41 | /// 42 | /// The label for the section. 43 | /// 44 | [Input("label", required: true)] 45 | public string Label { get; set; } = null!; 46 | 47 | public GetItemSectionArgs() 48 | { 49 | } 50 | public static new GetItemSectionArgs Empty => new GetItemSectionArgs(); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /sdk/dotnet/Inputs/GetItemSectionArgs.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.Onepassword.Inputs 11 | { 12 | 13 | public sealed class GetItemSectionInputArgs : global::Pulumi.ResourceArgs 14 | { 15 | [Input("fields")] 16 | private InputList? _fields; 17 | public InputList Fields 18 | { 19 | get => _fields ?? (_fields = new InputList()); 20 | set => _fields = value; 21 | } 22 | 23 | [Input("files")] 24 | private InputList? _files; 25 | 26 | /// 27 | /// A list of files attached to the section. 28 | /// 29 | public InputList Files 30 | { 31 | get => _files ?? (_files = new InputList()); 32 | set => _files = value; 33 | } 34 | 35 | /// 36 | /// A unique identifier for the section. 37 | /// 38 | [Input("id", required: true)] 39 | public Input Id { get; set; } = null!; 40 | 41 | /// 42 | /// The label for the section. 43 | /// 44 | [Input("label", required: true)] 45 | public Input Label { get; set; } = null!; 46 | 47 | public GetItemSectionInputArgs() 48 | { 49 | } 50 | public static new GetItemSectionInputArgs Empty => new GetItemSectionInputArgs(); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /sdk/dotnet/Inputs/GetItemSectionField.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.Onepassword.Inputs 11 | { 12 | 13 | public sealed class GetItemSectionFieldArgs : global::Pulumi.InvokeArgs 14 | { 15 | /// 16 | /// A unique identifier for the field. 17 | /// 18 | [Input("id", required: true)] 19 | public string Id { get; set; } = null!; 20 | 21 | /// 22 | /// The label for the field. 23 | /// 24 | [Input("label", required: true)] 25 | public string Label { get; set; } = null!; 26 | 27 | /// 28 | /// Purpose indicates this is a special field: a username, password, or notes field. One of ["USERNAME" "PASSWORD" "NOTES"] 29 | /// 30 | [Input("purpose", required: true)] 31 | public string Purpose { get; set; } = null!; 32 | 33 | /// 34 | /// The type of value stored in the field. One of ["STRING" "CONCEALED" "EMAIL" "URL" "OTP" "DATE" "MONTH_YEAR" "MENU"] 35 | /// 36 | [Input("type", required: true)] 37 | public string Type { get; set; } = null!; 38 | 39 | [Input("value", required: true)] 40 | private string? _value; 41 | 42 | /// 43 | /// The value of the field. 44 | /// 45 | public string? Value 46 | { 47 | get => _value; 48 | set => _value = value; 49 | } 50 | 51 | public GetItemSectionFieldArgs() 52 | { 53 | } 54 | public static new GetItemSectionFieldArgs Empty => new GetItemSectionFieldArgs(); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /sdk/dotnet/Inputs/GetItemSectionFieldArgs.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.Onepassword.Inputs 11 | { 12 | 13 | public sealed class GetItemSectionFieldInputArgs : global::Pulumi.ResourceArgs 14 | { 15 | /// 16 | /// A unique identifier for the field. 17 | /// 18 | [Input("id", required: true)] 19 | public Input Id { get; set; } = null!; 20 | 21 | /// 22 | /// The label for the field. 23 | /// 24 | [Input("label", required: true)] 25 | public Input Label { get; set; } = null!; 26 | 27 | /// 28 | /// Purpose indicates this is a special field: a username, password, or notes field. One of ["USERNAME" "PASSWORD" "NOTES"] 29 | /// 30 | [Input("purpose", required: true)] 31 | public Input Purpose { get; set; } = null!; 32 | 33 | /// 34 | /// The type of value stored in the field. One of ["STRING" "CONCEALED" "EMAIL" "URL" "OTP" "DATE" "MONTH_YEAR" "MENU"] 35 | /// 36 | [Input("type", required: true)] 37 | public Input Type { get; set; } = null!; 38 | 39 | [Input("value", required: true)] 40 | private Input? _value; 41 | 42 | /// 43 | /// The value of the field. 44 | /// 45 | public Input? Value 46 | { 47 | get => _value; 48 | set 49 | { 50 | var emptySecret = Output.CreateSecret(0); 51 | _value = Output.Tuple?, int>(value, emptySecret).Apply(t => t.Item1); 52 | } 53 | } 54 | 55 | public GetItemSectionFieldInputArgs() 56 | { 57 | } 58 | public static new GetItemSectionFieldInputArgs Empty => new GetItemSectionFieldInputArgs(); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /sdk/dotnet/Inputs/GetItemSectionFile.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.Onepassword.Inputs 11 | { 12 | 13 | public sealed class GetItemSectionFileArgs : global::Pulumi.InvokeArgs 14 | { 15 | [Input("content", required: true)] 16 | private string? _content; 17 | 18 | /// 19 | /// The content of the file. 20 | /// 21 | public string? Content 22 | { 23 | get => _content; 24 | set => _content = value; 25 | } 26 | 27 | [Input("contentBase64", required: true)] 28 | private string? _contentBase64; 29 | 30 | /// 31 | /// The content of the file in base64 encoding. (Use this for binary files.) 32 | /// 33 | public string? ContentBase64 34 | { 35 | get => _contentBase64; 36 | set => _contentBase64 = value; 37 | } 38 | 39 | /// 40 | /// The UUID of the file. 41 | /// 42 | [Input("id", required: true)] 43 | public string Id { get; set; } = null!; 44 | 45 | /// 46 | /// The name of the file. 47 | /// 48 | [Input("name", required: true)] 49 | public string Name { get; set; } = null!; 50 | 51 | public GetItemSectionFileArgs() 52 | { 53 | } 54 | public static new GetItemSectionFileArgs Empty => new GetItemSectionFileArgs(); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /sdk/dotnet/Inputs/GetItemSectionFileArgs.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.Onepassword.Inputs 11 | { 12 | 13 | public sealed class GetItemSectionFileInputArgs : global::Pulumi.ResourceArgs 14 | { 15 | [Input("content", required: true)] 16 | private Input? _content; 17 | 18 | /// 19 | /// The content of the file. 20 | /// 21 | public Input? Content 22 | { 23 | get => _content; 24 | set 25 | { 26 | var emptySecret = Output.CreateSecret(0); 27 | _content = Output.Tuple?, int>(value, emptySecret).Apply(t => t.Item1); 28 | } 29 | } 30 | 31 | [Input("contentBase64", required: true)] 32 | private Input? _contentBase64; 33 | 34 | /// 35 | /// The content of the file in base64 encoding. (Use this for binary files.) 36 | /// 37 | public Input? ContentBase64 38 | { 39 | get => _contentBase64; 40 | set 41 | { 42 | var emptySecret = Output.CreateSecret(0); 43 | _contentBase64 = Output.Tuple?, int>(value, emptySecret).Apply(t => t.Item1); 44 | } 45 | } 46 | 47 | /// 48 | /// The UUID of the file. 49 | /// 50 | [Input("id", required: true)] 51 | public Input Id { get; set; } = null!; 52 | 53 | /// 54 | /// The name of the file. 55 | /// 56 | [Input("name", required: true)] 57 | public Input Name { get; set; } = null!; 58 | 59 | public GetItemSectionFileInputArgs() 60 | { 61 | } 62 | public static new GetItemSectionFileInputArgs Empty => new GetItemSectionFileInputArgs(); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /sdk/dotnet/Inputs/ItemPasswordRecipeArgs.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.Onepassword.Inputs 11 | { 12 | 13 | public sealed class ItemPasswordRecipeArgs : global::Pulumi.ResourceArgs 14 | { 15 | /// 16 | /// Use digits [0-9] when generating the password. 17 | /// 18 | [Input("digits")] 19 | public Input? Digits { get; set; } 20 | 21 | /// 22 | /// The length of the password to be generated. 23 | /// 24 | [Input("length")] 25 | public Input? Length { get; set; } 26 | 27 | /// 28 | /// Use letters [a-zA-Z] when generating the password. 29 | /// 30 | [Input("letters")] 31 | public Input? Letters { get; set; } 32 | 33 | /// 34 | /// Use symbols [!@.-_*] when generating the password. 35 | /// 36 | [Input("symbols")] 37 | public Input? Symbols { get; set; } 38 | 39 | public ItemPasswordRecipeArgs() 40 | { 41 | } 42 | public static new ItemPasswordRecipeArgs Empty => new ItemPasswordRecipeArgs(); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /sdk/dotnet/Inputs/ItemPasswordRecipeGetArgs.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.Onepassword.Inputs 11 | { 12 | 13 | public sealed class ItemPasswordRecipeGetArgs : global::Pulumi.ResourceArgs 14 | { 15 | /// 16 | /// Use digits [0-9] when generating the password. 17 | /// 18 | [Input("digits")] 19 | public Input? Digits { get; set; } 20 | 21 | /// 22 | /// The length of the password to be generated. 23 | /// 24 | [Input("length")] 25 | public Input? Length { get; set; } 26 | 27 | /// 28 | /// Use letters [a-zA-Z] when generating the password. 29 | /// 30 | [Input("letters")] 31 | public Input? Letters { get; set; } 32 | 33 | /// 34 | /// Use symbols [!@.-_*] when generating the password. 35 | /// 36 | [Input("symbols")] 37 | public Input? Symbols { get; set; } 38 | 39 | public ItemPasswordRecipeGetArgs() 40 | { 41 | } 42 | public static new ItemPasswordRecipeGetArgs Empty => new ItemPasswordRecipeGetArgs(); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /sdk/dotnet/Inputs/ItemSectionArgs.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.Onepassword.Inputs 11 | { 12 | 13 | public sealed class ItemSectionArgs : global::Pulumi.ResourceArgs 14 | { 15 | [Input("fields")] 16 | private InputList? _fields; 17 | 18 | /// 19 | /// A list of custom fields in the section. 20 | /// 21 | public InputList Fields 22 | { 23 | get => _fields ?? (_fields = new InputList()); 24 | set => _fields = value; 25 | } 26 | 27 | /// 28 | /// A unique identifier for the section. 29 | /// 30 | [Input("id")] 31 | public Input? Id { get; set; } 32 | 33 | /// 34 | /// The label for the section. 35 | /// 36 | [Input("label", required: true)] 37 | public Input Label { get; set; } = null!; 38 | 39 | public ItemSectionArgs() 40 | { 41 | } 42 | public static new ItemSectionArgs Empty => new ItemSectionArgs(); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /sdk/dotnet/Inputs/ItemSectionFieldArgs.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.Onepassword.Inputs 11 | { 12 | 13 | public sealed class ItemSectionFieldArgs : global::Pulumi.ResourceArgs 14 | { 15 | /// 16 | /// A unique identifier for the field. 17 | /// 18 | [Input("id")] 19 | public Input? Id { get; set; } 20 | 21 | /// 22 | /// The label for the field. 23 | /// 24 | [Input("label", required: true)] 25 | public Input Label { get; set; } = null!; 26 | 27 | /// 28 | /// The recipe used to generate a new value for a password. 29 | /// 30 | [Input("passwordRecipe")] 31 | public Input? PasswordRecipe { get; set; } 32 | 33 | /// 34 | /// Purpose indicates this is a special field: a username, password, or notes field. One of ["USERNAME" "PASSWORD" "NOTES"] 35 | /// 36 | [Input("purpose")] 37 | public Input? Purpose { get; set; } 38 | 39 | /// 40 | /// The type of value stored in the field. One of ["STRING" "CONCEALED" "EMAIL" "URL" "OTP" "DATE" "MONTH_YEAR" "MENU"] 41 | /// 42 | [Input("type")] 43 | public Input? Type { get; set; } 44 | 45 | [Input("value")] 46 | private Input? _value; 47 | 48 | /// 49 | /// The value of the field. 50 | /// 51 | public Input? Value 52 | { 53 | get => _value; 54 | set 55 | { 56 | var emptySecret = Output.CreateSecret(0); 57 | _value = Output.Tuple?, int>(value, emptySecret).Apply(t => t.Item1); 58 | } 59 | } 60 | 61 | public ItemSectionFieldArgs() 62 | { 63 | } 64 | public static new ItemSectionFieldArgs Empty => new ItemSectionFieldArgs(); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /sdk/dotnet/Inputs/ItemSectionFieldGetArgs.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.Onepassword.Inputs 11 | { 12 | 13 | public sealed class ItemSectionFieldGetArgs : global::Pulumi.ResourceArgs 14 | { 15 | /// 16 | /// A unique identifier for the field. 17 | /// 18 | [Input("id")] 19 | public Input? Id { get; set; } 20 | 21 | /// 22 | /// The label for the field. 23 | /// 24 | [Input("label", required: true)] 25 | public Input Label { get; set; } = null!; 26 | 27 | /// 28 | /// The recipe used to generate a new value for a password. 29 | /// 30 | [Input("passwordRecipe")] 31 | public Input? PasswordRecipe { get; set; } 32 | 33 | /// 34 | /// Purpose indicates this is a special field: a username, password, or notes field. One of ["USERNAME" "PASSWORD" "NOTES"] 35 | /// 36 | [Input("purpose")] 37 | public Input? Purpose { get; set; } 38 | 39 | /// 40 | /// The type of value stored in the field. One of ["STRING" "CONCEALED" "EMAIL" "URL" "OTP" "DATE" "MONTH_YEAR" "MENU"] 41 | /// 42 | [Input("type")] 43 | public Input? Type { get; set; } 44 | 45 | [Input("value")] 46 | private Input? _value; 47 | 48 | /// 49 | /// The value of the field. 50 | /// 51 | public Input? Value 52 | { 53 | get => _value; 54 | set 55 | { 56 | var emptySecret = Output.CreateSecret(0); 57 | _value = Output.Tuple?, int>(value, emptySecret).Apply(t => t.Item1); 58 | } 59 | } 60 | 61 | public ItemSectionFieldGetArgs() 62 | { 63 | } 64 | public static new ItemSectionFieldGetArgs Empty => new ItemSectionFieldGetArgs(); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /sdk/dotnet/Inputs/ItemSectionFieldPasswordRecipeArgs.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.Onepassword.Inputs 11 | { 12 | 13 | public sealed class ItemSectionFieldPasswordRecipeArgs : global::Pulumi.ResourceArgs 14 | { 15 | /// 16 | /// Use digits [0-9] when generating the password. 17 | /// 18 | [Input("digits")] 19 | public Input? Digits { get; set; } 20 | 21 | /// 22 | /// The length of the password to be generated. 23 | /// 24 | [Input("length")] 25 | public Input? Length { get; set; } 26 | 27 | /// 28 | /// Use letters [a-zA-Z] when generating the password. 29 | /// 30 | [Input("letters")] 31 | public Input? Letters { get; set; } 32 | 33 | /// 34 | /// Use symbols [!@.-_*] when generating the password. 35 | /// 36 | [Input("symbols")] 37 | public Input? Symbols { get; set; } 38 | 39 | public ItemSectionFieldPasswordRecipeArgs() 40 | { 41 | } 42 | public static new ItemSectionFieldPasswordRecipeArgs Empty => new ItemSectionFieldPasswordRecipeArgs(); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /sdk/dotnet/Inputs/ItemSectionFieldPasswordRecipeGetArgs.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.Onepassword.Inputs 11 | { 12 | 13 | public sealed class ItemSectionFieldPasswordRecipeGetArgs : global::Pulumi.ResourceArgs 14 | { 15 | /// 16 | /// Use digits [0-9] when generating the password. 17 | /// 18 | [Input("digits")] 19 | public Input? Digits { get; set; } 20 | 21 | /// 22 | /// The length of the password to be generated. 23 | /// 24 | [Input("length")] 25 | public Input? Length { get; set; } 26 | 27 | /// 28 | /// Use letters [a-zA-Z] when generating the password. 29 | /// 30 | [Input("letters")] 31 | public Input? Letters { get; set; } 32 | 33 | /// 34 | /// Use symbols [!@.-_*] when generating the password. 35 | /// 36 | [Input("symbols")] 37 | public Input? Symbols { get; set; } 38 | 39 | public ItemSectionFieldPasswordRecipeGetArgs() 40 | { 41 | } 42 | public static new ItemSectionFieldPasswordRecipeGetArgs Empty => new ItemSectionFieldPasswordRecipeGetArgs(); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /sdk/dotnet/Inputs/ItemSectionGetArgs.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.Onepassword.Inputs 11 | { 12 | 13 | public sealed class ItemSectionGetArgs : global::Pulumi.ResourceArgs 14 | { 15 | [Input("fields")] 16 | private InputList? _fields; 17 | 18 | /// 19 | /// A list of custom fields in the section. 20 | /// 21 | public InputList Fields 22 | { 23 | get => _fields ?? (_fields = new InputList()); 24 | set => _fields = value; 25 | } 26 | 27 | /// 28 | /// A unique identifier for the section. 29 | /// 30 | [Input("id")] 31 | public Input? Id { get; set; } 32 | 33 | /// 34 | /// The label for the section. 35 | /// 36 | [Input("label", required: true)] 37 | public Input Label { get; set; } = null!; 38 | 39 | public ItemSectionGetArgs() 40 | { 41 | } 42 | public static new ItemSectionGetArgs Empty => new ItemSectionGetArgs(); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /sdk/dotnet/Outputs/GetItemFileResult.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.Onepassword.Outputs 11 | { 12 | 13 | [OutputType] 14 | public sealed class GetItemFileResult 15 | { 16 | /// 17 | /// The content of the file. 18 | /// 19 | public readonly string Content; 20 | /// 21 | /// The content of the file in base64 encoding. (Use this for binary files.) 22 | /// 23 | public readonly string ContentBase64; 24 | /// 25 | /// The UUID of the file. 26 | /// 27 | public readonly string Id; 28 | /// 29 | /// The name of the file. 30 | /// 31 | public readonly string Name; 32 | 33 | [OutputConstructor] 34 | private GetItemFileResult( 35 | string content, 36 | 37 | string contentBase64, 38 | 39 | string id, 40 | 41 | string name) 42 | { 43 | Content = content; 44 | ContentBase64 = contentBase64; 45 | Id = id; 46 | Name = name; 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /sdk/dotnet/Outputs/GetItemSectionFieldResult.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.Onepassword.Outputs 11 | { 12 | 13 | [OutputType] 14 | public sealed class GetItemSectionFieldResult 15 | { 16 | /// 17 | /// A unique identifier for the field. 18 | /// 19 | public readonly string Id; 20 | /// 21 | /// The label for the field. 22 | /// 23 | public readonly string Label; 24 | /// 25 | /// Purpose indicates this is a special field: a username, password, or notes field. One of ["USERNAME" "PASSWORD" "NOTES"] 26 | /// 27 | public readonly string Purpose; 28 | /// 29 | /// The type of value stored in the field. One of ["STRING" "CONCEALED" "EMAIL" "URL" "OTP" "DATE" "MONTH_YEAR" "MENU"] 30 | /// 31 | public readonly string Type; 32 | /// 33 | /// The value of the field. 34 | /// 35 | public readonly string Value; 36 | 37 | [OutputConstructor] 38 | private GetItemSectionFieldResult( 39 | string id, 40 | 41 | string label, 42 | 43 | string purpose, 44 | 45 | string type, 46 | 47 | string value) 48 | { 49 | Id = id; 50 | Label = label; 51 | Purpose = purpose; 52 | Type = type; 53 | Value = value; 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /sdk/dotnet/Outputs/GetItemSectionFileResult.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.Onepassword.Outputs 11 | { 12 | 13 | [OutputType] 14 | public sealed class GetItemSectionFileResult 15 | { 16 | /// 17 | /// The content of the file. 18 | /// 19 | public readonly string Content; 20 | /// 21 | /// The content of the file in base64 encoding. (Use this for binary files.) 22 | /// 23 | public readonly string ContentBase64; 24 | /// 25 | /// The UUID of the file. 26 | /// 27 | public readonly string Id; 28 | /// 29 | /// The name of the file. 30 | /// 31 | public readonly string Name; 32 | 33 | [OutputConstructor] 34 | private GetItemSectionFileResult( 35 | string content, 36 | 37 | string contentBase64, 38 | 39 | string id, 40 | 41 | string name) 42 | { 43 | Content = content; 44 | ContentBase64 = contentBase64; 45 | Id = id; 46 | Name = name; 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /sdk/dotnet/Outputs/GetItemSectionResult.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.Onepassword.Outputs 11 | { 12 | 13 | [OutputType] 14 | public sealed class GetItemSectionResult 15 | { 16 | public readonly ImmutableArray Fields; 17 | /// 18 | /// A list of files attached to the section. 19 | /// 20 | public readonly ImmutableArray Files; 21 | /// 22 | /// A unique identifier for the section. 23 | /// 24 | public readonly string Id; 25 | /// 26 | /// The label for the section. 27 | /// 28 | public readonly string Label; 29 | 30 | [OutputConstructor] 31 | private GetItemSectionResult( 32 | ImmutableArray fields, 33 | 34 | ImmutableArray files, 35 | 36 | string id, 37 | 38 | string label) 39 | { 40 | Fields = fields; 41 | Files = files; 42 | Id = id; 43 | Label = label; 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /sdk/dotnet/Outputs/ItemPasswordRecipe.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.Onepassword.Outputs 11 | { 12 | 13 | [OutputType] 14 | public sealed class ItemPasswordRecipe 15 | { 16 | /// 17 | /// Use digits [0-9] when generating the password. 18 | /// 19 | public readonly bool? Digits; 20 | /// 21 | /// The length of the password to be generated. 22 | /// 23 | public readonly int? Length; 24 | /// 25 | /// Use letters [a-zA-Z] when generating the password. 26 | /// 27 | public readonly bool? Letters; 28 | /// 29 | /// Use symbols [!@.-_*] when generating the password. 30 | /// 31 | public readonly bool? Symbols; 32 | 33 | [OutputConstructor] 34 | private ItemPasswordRecipe( 35 | bool? digits, 36 | 37 | int? length, 38 | 39 | bool? letters, 40 | 41 | bool? symbols) 42 | { 43 | Digits = digits; 44 | Length = length; 45 | Letters = letters; 46 | Symbols = symbols; 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /sdk/dotnet/Outputs/ItemSection.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.Onepassword.Outputs 11 | { 12 | 13 | [OutputType] 14 | public sealed class ItemSection 15 | { 16 | /// 17 | /// A list of custom fields in the section. 18 | /// 19 | public readonly ImmutableArray Fields; 20 | /// 21 | /// A unique identifier for the section. 22 | /// 23 | public readonly string? Id; 24 | /// 25 | /// The label for the section. 26 | /// 27 | public readonly string Label; 28 | 29 | [OutputConstructor] 30 | private ItemSection( 31 | ImmutableArray fields, 32 | 33 | string? id, 34 | 35 | string label) 36 | { 37 | Fields = fields; 38 | Id = id; 39 | Label = label; 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /sdk/dotnet/Outputs/ItemSectionField.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.Onepassword.Outputs 11 | { 12 | 13 | [OutputType] 14 | public sealed class ItemSectionField 15 | { 16 | /// 17 | /// A unique identifier for the field. 18 | /// 19 | public readonly string? Id; 20 | /// 21 | /// The label for the field. 22 | /// 23 | public readonly string Label; 24 | /// 25 | /// The recipe used to generate a new value for a password. 26 | /// 27 | public readonly Outputs.ItemSectionFieldPasswordRecipe? PasswordRecipe; 28 | /// 29 | /// Purpose indicates this is a special field: a username, password, or notes field. One of ["USERNAME" "PASSWORD" "NOTES"] 30 | /// 31 | public readonly string? Purpose; 32 | /// 33 | /// The type of value stored in the field. One of ["STRING" "CONCEALED" "EMAIL" "URL" "OTP" "DATE" "MONTH_YEAR" "MENU"] 34 | /// 35 | public readonly string? Type; 36 | /// 37 | /// The value of the field. 38 | /// 39 | public readonly string? Value; 40 | 41 | [OutputConstructor] 42 | private ItemSectionField( 43 | string? id, 44 | 45 | string label, 46 | 47 | Outputs.ItemSectionFieldPasswordRecipe? passwordRecipe, 48 | 49 | string? purpose, 50 | 51 | string? type, 52 | 53 | string? value) 54 | { 55 | Id = id; 56 | Label = label; 57 | PasswordRecipe = passwordRecipe; 58 | Purpose = purpose; 59 | Type = type; 60 | Value = value; 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /sdk/dotnet/Outputs/ItemSectionFieldPasswordRecipe.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.Onepassword.Outputs 11 | { 12 | 13 | [OutputType] 14 | public sealed class ItemSectionFieldPasswordRecipe 15 | { 16 | /// 17 | /// Use digits [0-9] when generating the password. 18 | /// 19 | public readonly bool? Digits; 20 | /// 21 | /// The length of the password to be generated. 22 | /// 23 | public readonly int? Length; 24 | /// 25 | /// Use letters [a-zA-Z] when generating the password. 26 | /// 27 | public readonly bool? Letters; 28 | /// 29 | /// Use symbols [!@.-_*] when generating the password. 30 | /// 31 | public readonly bool? Symbols; 32 | 33 | [OutputConstructor] 34 | private ItemSectionFieldPasswordRecipe( 35 | bool? digits, 36 | 37 | int? length, 38 | 39 | bool? letters, 40 | 41 | bool? symbols) 42 | { 43 | Digits = digits; 44 | Length = length; 45 | Letters = letters; 46 | Symbols = symbols; 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /sdk/dotnet/Provider.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.Onepassword 11 | { 12 | /// 13 | /// The provider type for the onepassword package. By default, resources use package-wide configuration 14 | /// settings, however an explicit `Provider` instance may be created and passed during resource 15 | /// construction to achieve fine-grained programmatic control over provider settings. See the 16 | /// [documentation](https://www.pulumi.com/docs/reference/programming-model/#providers) for more information. 17 | /// 18 | [OnepasswordResourceType("pulumi:providers:onepassword")] 19 | public partial class Provider : global::Pulumi.ProviderResource 20 | { 21 | /// 22 | /// A valid account's sign-in address or ID to use biometrics unlock. Can also be sourced from `OP_ACCOUNT` environment 23 | /// variable. Provider will use the 1Password CLI if set. 24 | /// 25 | [Output("account")] 26 | public Output Account { get; private set; } = null!; 27 | 28 | /// 29 | /// The path to the 1Password CLI binary. Can also be sourced from `OP_CLI_PATH` environment variable. Defaults to `op`. 30 | /// 31 | [Output("opCliPath")] 32 | public Output OpCliPath { get; private set; } = null!; 33 | 34 | /// 35 | /// A valid 1Password service account token. Can also be sourced from `OP_SERVICE_ACCOUNT_TOKEN` environment variable. 36 | /// Provider will use the 1Password CLI if set. 37 | /// 38 | [Output("serviceAccountToken")] 39 | public Output ServiceAccountToken { get; private set; } = null!; 40 | 41 | /// 42 | /// A valid token for your 1Password Connect server. Can also be sourced from `OP_CONNECT_TOKEN` environment variable. 43 | /// Provider will use 1Password Connect server if set. 44 | /// 45 | [Output("token")] 46 | public Output Token { get; private set; } = null!; 47 | 48 | /// 49 | /// The HTTP(S) URL where your 1Password Connect server can be found. Can also be sourced `OP_CONNECT_HOST` environment 50 | /// variable. Provider will use 1Password Connect server if set. 51 | /// 52 | [Output("url")] 53 | public Output Url { get; private set; } = null!; 54 | 55 | 56 | /// 57 | /// Create a Provider resource with the given unique name, arguments, and options. 58 | /// 59 | /// 60 | /// The unique name of the resource 61 | /// The arguments used to populate this resource's properties 62 | /// A bag of options that control this resource's behavior 63 | public Provider(string name, ProviderArgs? args = null, CustomResourceOptions? options = null) 64 | : base("onepassword", name, args ?? new ProviderArgs(), MakeResourceOptions(options, "")) 65 | { 66 | } 67 | 68 | private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input? id) 69 | { 70 | var defaultOptions = new CustomResourceOptions 71 | { 72 | Version = Utilities.Version, 73 | PluginDownloadURL = "github://api.github.com/1Password/pulumi-onepassword", 74 | AdditionalSecretOutputs = 75 | { 76 | "serviceAccountToken", 77 | "token", 78 | }, 79 | }; 80 | var merged = CustomResourceOptions.Merge(defaultOptions, options); 81 | // Override the ID if one was specified for consistency with other language SDKs. 82 | merged.Id = id ?? merged.Id; 83 | return merged; 84 | } 85 | } 86 | 87 | public sealed class ProviderArgs : global::Pulumi.ResourceArgs 88 | { 89 | /// 90 | /// A valid account's sign-in address or ID to use biometrics unlock. Can also be sourced from `OP_ACCOUNT` environment 91 | /// variable. Provider will use the 1Password CLI if set. 92 | /// 93 | [Input("account")] 94 | public Input? Account { get; set; } 95 | 96 | /// 97 | /// The path to the 1Password CLI binary. Can also be sourced from `OP_CLI_PATH` environment variable. Defaults to `op`. 98 | /// 99 | [Input("opCliPath")] 100 | public Input? OpCliPath { get; set; } 101 | 102 | [Input("serviceAccountToken")] 103 | private Input? _serviceAccountToken; 104 | 105 | /// 106 | /// A valid 1Password service account token. Can also be sourced from `OP_SERVICE_ACCOUNT_TOKEN` environment variable. 107 | /// Provider will use the 1Password CLI if set. 108 | /// 109 | public Input? ServiceAccountToken 110 | { 111 | get => _serviceAccountToken; 112 | set 113 | { 114 | var emptySecret = Output.CreateSecret(0); 115 | _serviceAccountToken = Output.Tuple?, int>(value, emptySecret).Apply(t => t.Item1); 116 | } 117 | } 118 | 119 | [Input("token")] 120 | private Input? _token; 121 | 122 | /// 123 | /// A valid token for your 1Password Connect server. Can also be sourced from `OP_CONNECT_TOKEN` environment variable. 124 | /// Provider will use 1Password Connect server if set. 125 | /// 126 | public Input? Token 127 | { 128 | get => _token; 129 | set 130 | { 131 | var emptySecret = Output.CreateSecret(0); 132 | _token = Output.Tuple?, int>(value, emptySecret).Apply(t => t.Item1); 133 | } 134 | } 135 | 136 | /// 137 | /// The HTTP(S) URL where your 1Password Connect server can be found. Can also be sourced `OP_CONNECT_HOST` environment 138 | /// variable. Provider will use 1Password Connect server if set. 139 | /// 140 | [Input("url")] 141 | public Input? Url { get; set; } 142 | 143 | public ProviderArgs() 144 | { 145 | Account = Utilities.GetEnv("OP_ACCOUNT"); 146 | OpCliPath = Utilities.GetEnv("OP_CLI_PATH"); 147 | ServiceAccountToken = Utilities.GetEnv("OP_SERVICE_ACCOUNT_TOKEN"); 148 | Token = Utilities.GetEnv("OP_CONNECT_TOKEN"); 149 | Url = Utilities.GetEnv("OP_CONNECT_HOST"); 150 | } 151 | public static new ProviderArgs Empty => new ProviderArgs(); 152 | } 153 | } 154 | -------------------------------------------------------------------------------- /sdk/dotnet/Pulumi.Onepassword.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | true 5 | 1Password 6 | 1Password 7 | Use the 1Password Pulumi provider to access and manage items in your 1Password vaults. 8 | Apache-2.0 9 | https://www.developer.1password.com 10 | https://github.com/1Password/pulumi-onepassword 11 | logo.png 12 | 13 | net6.0 14 | enable 15 | 16 | 17 | 18 | true 19 | 1701;1702;1591 20 | 21 | 22 | 23 | $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb 24 | true 25 | true 26 | 27 | 28 | 29 | true 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | True 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /sdk/dotnet/Pulumi.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1Password/pulumi-onepassword/559bf4f66874e6ac6875fdb08cfe71ab0b98b273/sdk/dotnet/Pulumi.yaml -------------------------------------------------------------------------------- /sdk/dotnet/README.md: -------------------------------------------------------------------------------- 1 | Use the 1Password Pulumi provider to access and manage items in your 1Password vaults. 2 | -------------------------------------------------------------------------------- /sdk/dotnet/Utilities.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | namespace Pulumi.Onepassword 5 | { 6 | static class Utilities 7 | { 8 | public static string? GetEnv(params string[] names) 9 | { 10 | foreach (var n in names) 11 | { 12 | var value = global::System.Environment.GetEnvironmentVariable(n); 13 | if (value != null) 14 | { 15 | return value; 16 | } 17 | } 18 | return null; 19 | } 20 | 21 | static string[] trueValues = { "1", "t", "T", "true", "TRUE", "True" }; 22 | static string[] falseValues = { "0", "f", "F", "false", "FALSE", "False" }; 23 | public static bool? GetEnvBoolean(params string[] names) 24 | { 25 | var s = GetEnv(names); 26 | if (s != null) 27 | { 28 | if (global::System.Array.IndexOf(trueValues, s) != -1) 29 | { 30 | return true; 31 | } 32 | if (global::System.Array.IndexOf(falseValues, s) != -1) 33 | { 34 | return false; 35 | } 36 | } 37 | return null; 38 | } 39 | 40 | public static int? GetEnvInt32(params string[] names) => int.TryParse(GetEnv(names), out int v) ? (int?)v : null; 41 | 42 | public static double? GetEnvDouble(params string[] names) => double.TryParse(GetEnv(names), out double v) ? (double?)v : null; 43 | 44 | [global::System.Obsolete("Please use WithDefaults instead")] 45 | public static global::Pulumi.InvokeOptions WithVersion(this global::Pulumi.InvokeOptions? options) 46 | { 47 | var dst = options ?? new global::Pulumi.InvokeOptions{}; 48 | dst.Version = options?.Version ?? Version; 49 | return dst; 50 | } 51 | 52 | public static global::Pulumi.InvokeOptions WithDefaults(this global::Pulumi.InvokeOptions? src) 53 | { 54 | var dst = src ?? new global::Pulumi.InvokeOptions{}; 55 | dst.Version = src?.Version ?? Version; 56 | dst.PluginDownloadURL = src?.PluginDownloadURL ?? "github://api.github.com/1Password/pulumi-onepassword"; 57 | return dst; 58 | } 59 | 60 | private readonly static string version; 61 | public static string Version => version; 62 | 63 | static Utilities() 64 | { 65 | var assembly = global::System.Reflection.IntrospectionExtensions.GetTypeInfo(typeof(Utilities)).Assembly; 66 | using var stream = assembly.GetManifestResourceStream("Pulumi.Onepassword.version.txt"); 67 | using var reader = new global::System.IO.StreamReader(stream ?? throw new global::System.NotSupportedException("Missing embedded version.txt file")); 68 | version = reader.ReadToEnd().Trim(); 69 | var parts = version.Split("\n"); 70 | if (parts.Length == 2) 71 | { 72 | // The first part is the provider name. 73 | version = parts[1].Trim(); 74 | } 75 | } 76 | } 77 | 78 | internal sealed class OnepasswordResourceTypeAttribute : global::Pulumi.ResourceTypeAttribute 79 | { 80 | public OnepasswordResourceTypeAttribute(string type) : base(type, Utilities.Version) 81 | { 82 | } 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /sdk/dotnet/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1Password/pulumi-onepassword/559bf4f66874e6ac6875fdb08cfe71ab0b98b273/sdk/dotnet/logo.png -------------------------------------------------------------------------------- /sdk/dotnet/pulumi-plugin.json: -------------------------------------------------------------------------------- 1 | { 2 | "resource": true, 3 | "name": "onepassword", 4 | "server": "github://api.github.com/1Password/pulumi-onepassword" 5 | } 6 | -------------------------------------------------------------------------------- /sdk/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/1Password/pulumi-onepassword/sdk 2 | 3 | go 1.21 4 | 5 | require ( 6 | github.com/blang/semver v3.5.1+incompatible 7 | github.com/pulumi/pulumi/sdk/v3 v3.116.1 8 | ) 9 | 10 | require ( 11 | dario.cat/mergo v1.0.0 // indirect 12 | github.com/Microsoft/go-winio v0.6.1 // indirect 13 | github.com/ProtonMail/go-crypto v1.0.0 // indirect 14 | github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da // indirect 15 | github.com/agext/levenshtein v1.2.3 // indirect 16 | github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect 17 | github.com/atotto/clipboard v0.1.4 // indirect 18 | github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect 19 | github.com/charmbracelet/bubbles v0.16.1 // indirect 20 | github.com/charmbracelet/bubbletea v0.24.2 // indirect 21 | github.com/charmbracelet/lipgloss v0.7.1 // indirect 22 | github.com/cheggaaa/pb v1.0.29 // indirect 23 | github.com/cloudflare/circl v1.3.7 // indirect 24 | github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 // indirect 25 | github.com/cyphar/filepath-securejoin v0.2.4 // indirect 26 | github.com/djherbis/times v1.5.0 // indirect 27 | github.com/emirpasic/gods v1.18.1 // indirect 28 | github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect 29 | github.com/go-git/go-billy/v5 v5.5.0 // indirect 30 | github.com/go-git/go-git/v5 v5.12.0 // indirect 31 | github.com/gogo/protobuf v1.3.2 // indirect 32 | github.com/golang/glog v1.2.0 // indirect 33 | github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect 34 | github.com/google/uuid v1.6.0 // indirect 35 | github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 // indirect 36 | github.com/hashicorp/errwrap v1.1.0 // indirect 37 | github.com/hashicorp/go-multierror v1.1.1 // indirect 38 | github.com/hashicorp/hcl/v2 v2.17.0 // indirect 39 | github.com/inconshreveable/mousetrap v1.1.0 // indirect 40 | github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect 41 | github.com/kevinburke/ssh_config v1.2.0 // indirect 42 | github.com/lucasb-eyer/go-colorful v1.2.0 // indirect 43 | github.com/mattn/go-isatty v0.0.20 // indirect 44 | github.com/mattn/go-localereader v0.0.1 // indirect 45 | github.com/mattn/go-runewidth v0.0.15 // indirect 46 | github.com/mitchellh/go-ps v1.0.0 // indirect 47 | github.com/mitchellh/go-wordwrap v1.0.1 // indirect 48 | github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect 49 | github.com/muesli/cancelreader v0.2.2 // indirect 50 | github.com/muesli/reflow v0.3.0 // indirect 51 | github.com/muesli/termenv v0.15.2 // indirect 52 | github.com/opentracing/basictracer-go v1.1.0 // indirect 53 | github.com/opentracing/opentracing-go v1.2.0 // indirect 54 | github.com/pgavlin/fx v0.1.6 // indirect 55 | github.com/pjbgf/sha1cd v0.3.0 // indirect 56 | github.com/pkg/errors v0.9.1 // indirect 57 | github.com/pkg/term v1.1.0 // indirect 58 | github.com/pulumi/appdash v0.0.0-20231130102222-75f619a67231 // indirect 59 | github.com/pulumi/esc v0.6.2 // indirect 60 | github.com/rivo/uniseg v0.4.4 // indirect 61 | github.com/rogpeppe/go-internal v1.11.0 // indirect 62 | github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 // indirect 63 | github.com/santhosh-tekuri/jsonschema/v5 v5.0.0 // indirect 64 | github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect 65 | github.com/skeema/knownhosts v1.2.2 // indirect 66 | github.com/spf13/cast v1.4.1 // indirect 67 | github.com/spf13/cobra v1.7.0 // indirect 68 | github.com/spf13/pflag v1.0.5 // indirect 69 | github.com/texttheater/golang-levenshtein v1.0.1 // indirect 70 | github.com/tweekmonster/luser v0.0.0-20161003172636-3fa38070dbd7 // indirect 71 | github.com/uber/jaeger-client-go v2.30.0+incompatible // indirect 72 | github.com/uber/jaeger-lib v2.4.1+incompatible // indirect 73 | github.com/xanzy/ssh-agent v0.3.3 // indirect 74 | github.com/zclconf/go-cty v1.13.2 // indirect 75 | go.uber.org/atomic v1.9.0 // indirect 76 | golang.org/x/crypto v0.22.0 // indirect 77 | golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa // indirect 78 | golang.org/x/mod v0.14.0 // indirect 79 | golang.org/x/net v0.23.0 // indirect 80 | golang.org/x/sync v0.6.0 // indirect 81 | golang.org/x/sys v0.19.0 // indirect 82 | golang.org/x/term v0.19.0 // indirect 83 | golang.org/x/text v0.14.0 // indirect 84 | golang.org/x/tools v0.15.0 // indirect 85 | google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de // indirect 86 | google.golang.org/grpc v1.63.2 // indirect 87 | google.golang.org/protobuf v1.33.0 // indirect 88 | gopkg.in/warnings.v0 v0.1.2 // indirect 89 | gopkg.in/yaml.v3 v3.0.1 // indirect 90 | lukechampine.com/frand v1.4.2 // indirect 91 | ) 92 | -------------------------------------------------------------------------------- /sdk/go/Pulumi.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1Password/pulumi-onepassword/559bf4f66874e6ac6875fdb08cfe71ab0b98b273/sdk/go/Pulumi.yaml -------------------------------------------------------------------------------- /sdk/go/onepassword/config/config.go: -------------------------------------------------------------------------------- 1 | // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. 2 | // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | package config 5 | 6 | import ( 7 | "github.com/1Password/pulumi-onepassword/sdk/go/onepassword/internal" 8 | "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 9 | "github.com/pulumi/pulumi/sdk/v3/go/pulumi/config" 10 | ) 11 | 12 | var _ = internal.GetEnvOrDefault 13 | 14 | // A valid account's sign-in address or ID to use biometrics unlock. Can also be sourced from `OP_ACCOUNT` environment 15 | // variable. Provider will use the 1Password CLI if set. 16 | func GetAccount(ctx *pulumi.Context) string { 17 | v, err := config.Try(ctx, "onepassword:account") 18 | if err == nil { 19 | return v 20 | } 21 | var value string 22 | if d := internal.GetEnvOrDefault(nil, nil, "OP_ACCOUNT"); d != nil { 23 | value = d.(string) 24 | } 25 | return value 26 | } 27 | 28 | // The path to the 1Password CLI binary. Can also be sourced from `OP_CLI_PATH` environment variable. Defaults to `op`. 29 | func GetOpCliPath(ctx *pulumi.Context) string { 30 | v, err := config.Try(ctx, "onepassword:opCliPath") 31 | if err == nil { 32 | return v 33 | } 34 | var value string 35 | if d := internal.GetEnvOrDefault(nil, nil, "OP_CLI_PATH"); d != nil { 36 | value = d.(string) 37 | } 38 | return value 39 | } 40 | 41 | // A valid 1Password service account token. Can also be sourced from `OP_SERVICE_ACCOUNT_TOKEN` environment variable. 42 | // Provider will use the 1Password CLI if set. 43 | func GetServiceAccountToken(ctx *pulumi.Context) string { 44 | v, err := config.Try(ctx, "onepassword:serviceAccountToken") 45 | if err == nil { 46 | return v 47 | } 48 | var value string 49 | if d := internal.GetEnvOrDefault(nil, nil, "OP_SERVICE_ACCOUNT_TOKEN"); d != nil { 50 | value = d.(string) 51 | } 52 | return value 53 | } 54 | 55 | // A valid token for your 1Password Connect server. Can also be sourced from `OP_CONNECT_TOKEN` environment variable. 56 | // Provider will use 1Password Connect server if set. 57 | func GetToken(ctx *pulumi.Context) string { 58 | v, err := config.Try(ctx, "onepassword:token") 59 | if err == nil { 60 | return v 61 | } 62 | var value string 63 | if d := internal.GetEnvOrDefault(nil, nil, "OP_CONNECT_TOKEN"); d != nil { 64 | value = d.(string) 65 | } 66 | return value 67 | } 68 | 69 | // The HTTP(S) URL where your 1Password Connect server can be found. Can also be sourced `OP_CONNECT_HOST` environment 70 | // variable. Provider will use 1Password Connect server if set. 71 | func GetUrl(ctx *pulumi.Context) string { 72 | v, err := config.Try(ctx, "onepassword:url") 73 | if err == nil { 74 | return v 75 | } 76 | var value string 77 | if d := internal.GetEnvOrDefault(nil, nil, "OP_CONNECT_HOST"); d != nil { 78 | value = d.(string) 79 | } 80 | return value 81 | } 82 | -------------------------------------------------------------------------------- /sdk/go/onepassword/doc.go: -------------------------------------------------------------------------------- 1 | // Use the 1Password Pulumi provider to access and manage items in your 1Password vaults. 2 | package onepassword 3 | -------------------------------------------------------------------------------- /sdk/go/onepassword/getItem.go: -------------------------------------------------------------------------------- 1 | // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. 2 | // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | package onepassword 5 | 6 | import ( 7 | "context" 8 | "reflect" 9 | 10 | "github.com/1Password/pulumi-onepassword/sdk/go/onepassword/internal" 11 | "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 12 | ) 13 | 14 | // Use this data source to get details of an item by its vault uuid and either the title or the uuid of the item. 15 | // 16 | // ## Example Usage 17 | // 18 | // ```go 19 | // package main 20 | // 21 | // import ( 22 | // 23 | // "github.com/1Password/pulumi-onepassword/sdk/go/onepassword" 24 | // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 25 | // 26 | // ) 27 | // 28 | // func main() { 29 | // pulumi.Run(func(ctx *pulumi.Context) error { 30 | // _, err := onepassword.LookupItem(ctx, &onepassword.LookupItemArgs{ 31 | // Title: pulumi.StringRef("your-item-title"), 32 | // Vault: "your-vault-id", 33 | // }, nil) 34 | // if err != nil { 35 | // return err 36 | // } 37 | // return nil 38 | // }) 39 | // } 40 | // 41 | // ``` 42 | func LookupItem(ctx *pulumi.Context, args *LookupItemArgs, opts ...pulumi.InvokeOption) (*LookupItemResult, error) { 43 | opts = internal.PkgInvokeDefaultOpts(opts) 44 | var rv LookupItemResult 45 | err := ctx.Invoke("onepassword:index/getItem:getItem", args, &rv, opts...) 46 | if err != nil { 47 | return nil, err 48 | } 49 | return &rv, nil 50 | } 51 | 52 | // A collection of arguments for invoking getItem. 53 | type LookupItemArgs struct { 54 | // A list of files attached to the item. 55 | Files []GetItemFile `pulumi:"files"` 56 | // Secure Note value. 57 | NoteValue *string `pulumi:"noteValue"` 58 | // A list of custom sections in an item 59 | Sections []GetItemSection `pulumi:"sections"` 60 | // The title of the item to retrieve. This field will be populated with the title of the item if the item it looked up by its UUID. 61 | Title *string `pulumi:"title"` 62 | // The UUID of the item to retrieve. This field will be populated with the UUID of the item if the item it looked up by its title. 63 | Uuid *string `pulumi:"uuid"` 64 | // The UUID of the vault the item is in. 65 | Vault string `pulumi:"vault"` 66 | } 67 | 68 | // A collection of values returned by getItem. 69 | type LookupItemResult struct { 70 | // The category of the item. One of ["login" "password" "database" "secure*note" "document" "ssh*key"] 71 | Category string `pulumi:"category"` 72 | // API credential for this item. 73 | Credential string `pulumi:"credential"` 74 | // (Only applies to the database category) The name of the database. 75 | Database string `pulumi:"database"` 76 | // A list of files attached to the item. 77 | Files []GetItemFile `pulumi:"files"` 78 | // (Only applies to the database category) The address where the database can be found 79 | Hostname string `pulumi:"hostname"` 80 | Id string `pulumi:"id"` 81 | // Secure Note value. 82 | NoteValue string `pulumi:"noteValue"` 83 | // Password for this item. 84 | Password string `pulumi:"password"` 85 | // (Only applies to the database category) The port the database is listening on. 86 | Port string `pulumi:"port"` 87 | // SSH Private Key for this item. 88 | PrivateKey string `pulumi:"privateKey"` 89 | // SSH Public Key for this item. 90 | PublicKey string `pulumi:"publicKey"` 91 | // A list of custom sections in an item 92 | Sections []GetItemSection `pulumi:"sections"` 93 | // An array of strings of the tags assigned to the item. 94 | Tags []string `pulumi:"tags"` 95 | // The title of the item to retrieve. This field will be populated with the title of the item if the item it looked up by its UUID. 96 | Title string `pulumi:"title"` 97 | // (Only applies to the database category) The type of database. One of ["db2" "filemaker" "msaccess" "mssql" "mysql" "oracle" "postgresql" "sqlite" "other"] 98 | Type string `pulumi:"type"` 99 | // The primary URL for the item. 100 | Url string `pulumi:"url"` 101 | // Username for this item. 102 | Username string `pulumi:"username"` 103 | // The UUID of the item to retrieve. This field will be populated with the UUID of the item if the item it looked up by its title. 104 | Uuid string `pulumi:"uuid"` 105 | // The UUID of the vault the item is in. 106 | Vault string `pulumi:"vault"` 107 | } 108 | 109 | func LookupItemOutput(ctx *pulumi.Context, args LookupItemOutputArgs, opts ...pulumi.InvokeOption) LookupItemResultOutput { 110 | return pulumi.ToOutputWithContext(context.Background(), args). 111 | ApplyT(func(v interface{}) (LookupItemResult, error) { 112 | args := v.(LookupItemArgs) 113 | r, err := LookupItem(ctx, &args, opts...) 114 | var s LookupItemResult 115 | if r != nil { 116 | s = *r 117 | } 118 | return s, err 119 | }).(LookupItemResultOutput) 120 | } 121 | 122 | // A collection of arguments for invoking getItem. 123 | type LookupItemOutputArgs struct { 124 | // A list of files attached to the item. 125 | Files GetItemFileArrayInput `pulumi:"files"` 126 | // Secure Note value. 127 | NoteValue pulumi.StringPtrInput `pulumi:"noteValue"` 128 | // A list of custom sections in an item 129 | Sections GetItemSectionArrayInput `pulumi:"sections"` 130 | // The title of the item to retrieve. This field will be populated with the title of the item if the item it looked up by its UUID. 131 | Title pulumi.StringPtrInput `pulumi:"title"` 132 | // The UUID of the item to retrieve. This field will be populated with the UUID of the item if the item it looked up by its title. 133 | Uuid pulumi.StringPtrInput `pulumi:"uuid"` 134 | // The UUID of the vault the item is in. 135 | Vault pulumi.StringInput `pulumi:"vault"` 136 | } 137 | 138 | func (LookupItemOutputArgs) ElementType() reflect.Type { 139 | return reflect.TypeOf((*LookupItemArgs)(nil)).Elem() 140 | } 141 | 142 | // A collection of values returned by getItem. 143 | type LookupItemResultOutput struct{ *pulumi.OutputState } 144 | 145 | func (LookupItemResultOutput) ElementType() reflect.Type { 146 | return reflect.TypeOf((*LookupItemResult)(nil)).Elem() 147 | } 148 | 149 | func (o LookupItemResultOutput) ToLookupItemResultOutput() LookupItemResultOutput { 150 | return o 151 | } 152 | 153 | func (o LookupItemResultOutput) ToLookupItemResultOutputWithContext(ctx context.Context) LookupItemResultOutput { 154 | return o 155 | } 156 | 157 | // The category of the item. One of ["login" "password" "database" "secure*note" "document" "ssh*key"] 158 | func (o LookupItemResultOutput) Category() pulumi.StringOutput { 159 | return o.ApplyT(func(v LookupItemResult) string { return v.Category }).(pulumi.StringOutput) 160 | } 161 | 162 | // API credential for this item. 163 | func (o LookupItemResultOutput) Credential() pulumi.StringOutput { 164 | return o.ApplyT(func(v LookupItemResult) string { return v.Credential }).(pulumi.StringOutput) 165 | } 166 | 167 | // (Only applies to the database category) The name of the database. 168 | func (o LookupItemResultOutput) Database() pulumi.StringOutput { 169 | return o.ApplyT(func(v LookupItemResult) string { return v.Database }).(pulumi.StringOutput) 170 | } 171 | 172 | // A list of files attached to the item. 173 | func (o LookupItemResultOutput) Files() GetItemFileArrayOutput { 174 | return o.ApplyT(func(v LookupItemResult) []GetItemFile { return v.Files }).(GetItemFileArrayOutput) 175 | } 176 | 177 | // (Only applies to the database category) The address where the database can be found 178 | func (o LookupItemResultOutput) Hostname() pulumi.StringOutput { 179 | return o.ApplyT(func(v LookupItemResult) string { return v.Hostname }).(pulumi.StringOutput) 180 | } 181 | 182 | func (o LookupItemResultOutput) Id() pulumi.StringOutput { 183 | return o.ApplyT(func(v LookupItemResult) string { return v.Id }).(pulumi.StringOutput) 184 | } 185 | 186 | // Secure Note value. 187 | func (o LookupItemResultOutput) NoteValue() pulumi.StringOutput { 188 | return o.ApplyT(func(v LookupItemResult) string { return v.NoteValue }).(pulumi.StringOutput) 189 | } 190 | 191 | // Password for this item. 192 | func (o LookupItemResultOutput) Password() pulumi.StringOutput { 193 | return o.ApplyT(func(v LookupItemResult) string { return v.Password }).(pulumi.StringOutput) 194 | } 195 | 196 | // (Only applies to the database category) The port the database is listening on. 197 | func (o LookupItemResultOutput) Port() pulumi.StringOutput { 198 | return o.ApplyT(func(v LookupItemResult) string { return v.Port }).(pulumi.StringOutput) 199 | } 200 | 201 | // SSH Private Key for this item. 202 | func (o LookupItemResultOutput) PrivateKey() pulumi.StringOutput { 203 | return o.ApplyT(func(v LookupItemResult) string { return v.PrivateKey }).(pulumi.StringOutput) 204 | } 205 | 206 | // SSH Public Key for this item. 207 | func (o LookupItemResultOutput) PublicKey() pulumi.StringOutput { 208 | return o.ApplyT(func(v LookupItemResult) string { return v.PublicKey }).(pulumi.StringOutput) 209 | } 210 | 211 | // A list of custom sections in an item 212 | func (o LookupItemResultOutput) Sections() GetItemSectionArrayOutput { 213 | return o.ApplyT(func(v LookupItemResult) []GetItemSection { return v.Sections }).(GetItemSectionArrayOutput) 214 | } 215 | 216 | // An array of strings of the tags assigned to the item. 217 | func (o LookupItemResultOutput) Tags() pulumi.StringArrayOutput { 218 | return o.ApplyT(func(v LookupItemResult) []string { return v.Tags }).(pulumi.StringArrayOutput) 219 | } 220 | 221 | // The title of the item to retrieve. This field will be populated with the title of the item if the item it looked up by its UUID. 222 | func (o LookupItemResultOutput) Title() pulumi.StringOutput { 223 | return o.ApplyT(func(v LookupItemResult) string { return v.Title }).(pulumi.StringOutput) 224 | } 225 | 226 | // (Only applies to the database category) The type of database. One of ["db2" "filemaker" "msaccess" "mssql" "mysql" "oracle" "postgresql" "sqlite" "other"] 227 | func (o LookupItemResultOutput) Type() pulumi.StringOutput { 228 | return o.ApplyT(func(v LookupItemResult) string { return v.Type }).(pulumi.StringOutput) 229 | } 230 | 231 | // The primary URL for the item. 232 | func (o LookupItemResultOutput) Url() pulumi.StringOutput { 233 | return o.ApplyT(func(v LookupItemResult) string { return v.Url }).(pulumi.StringOutput) 234 | } 235 | 236 | // Username for this item. 237 | func (o LookupItemResultOutput) Username() pulumi.StringOutput { 238 | return o.ApplyT(func(v LookupItemResult) string { return v.Username }).(pulumi.StringOutput) 239 | } 240 | 241 | // The UUID of the item to retrieve. This field will be populated with the UUID of the item if the item it looked up by its title. 242 | func (o LookupItemResultOutput) Uuid() pulumi.StringOutput { 243 | return o.ApplyT(func(v LookupItemResult) string { return v.Uuid }).(pulumi.StringOutput) 244 | } 245 | 246 | // The UUID of the vault the item is in. 247 | func (o LookupItemResultOutput) Vault() pulumi.StringOutput { 248 | return o.ApplyT(func(v LookupItemResult) string { return v.Vault }).(pulumi.StringOutput) 249 | } 250 | 251 | func init() { 252 | pulumi.RegisterOutputType(LookupItemResultOutput{}) 253 | } 254 | -------------------------------------------------------------------------------- /sdk/go/onepassword/getVault.go: -------------------------------------------------------------------------------- 1 | // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. 2 | // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | package onepassword 5 | 6 | import ( 7 | "context" 8 | "reflect" 9 | 10 | "github.com/1Password/pulumi-onepassword/sdk/go/onepassword/internal" 11 | "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 12 | ) 13 | 14 | // Use this data source to get details of a vault by either its name or uuid. 15 | // 16 | // ## Example Usage 17 | // 18 | // ```go 19 | // package main 20 | // 21 | // import ( 22 | // 23 | // "github.com/1Password/pulumi-onepassword/sdk/go/onepassword" 24 | // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 25 | // 26 | // ) 27 | // 28 | // func main() { 29 | // pulumi.Run(func(ctx *pulumi.Context) error { 30 | // _, err := onepassword.GetVault(ctx, &onepassword.GetVaultArgs{ 31 | // Name: pulumi.StringRef("your-vault-name"), 32 | // }, nil) 33 | // if err != nil { 34 | // return err 35 | // } 36 | // return nil 37 | // }) 38 | // } 39 | // 40 | // ``` 41 | func GetVault(ctx *pulumi.Context, args *GetVaultArgs, opts ...pulumi.InvokeOption) (*GetVaultResult, error) { 42 | opts = internal.PkgInvokeDefaultOpts(opts) 43 | var rv GetVaultResult 44 | err := ctx.Invoke("onepassword:index/getVault:getVault", args, &rv, opts...) 45 | if err != nil { 46 | return nil, err 47 | } 48 | return &rv, nil 49 | } 50 | 51 | // A collection of arguments for invoking getVault. 52 | type GetVaultArgs struct { 53 | // The name of the vault to retrieve. This field will be populated with the name of the vault if the vault it looked up by its UUID. 54 | Name *string `pulumi:"name"` 55 | // The UUID of the vault to retrieve. This field will be populated with the UUID of the vault if the vault it looked up by its name. 56 | Uuid *string `pulumi:"uuid"` 57 | } 58 | 59 | // A collection of values returned by getVault. 60 | type GetVaultResult struct { 61 | // The description of the vault. 62 | Description string `pulumi:"description"` 63 | Id string `pulumi:"id"` 64 | // The name of the vault to retrieve. This field will be populated with the name of the vault if the vault it looked up by its UUID. 65 | Name string `pulumi:"name"` 66 | // The UUID of the vault to retrieve. This field will be populated with the UUID of the vault if the vault it looked up by its name. 67 | Uuid string `pulumi:"uuid"` 68 | } 69 | 70 | func GetVaultOutput(ctx *pulumi.Context, args GetVaultOutputArgs, opts ...pulumi.InvokeOption) GetVaultResultOutput { 71 | return pulumi.ToOutputWithContext(context.Background(), args). 72 | ApplyT(func(v interface{}) (GetVaultResult, error) { 73 | args := v.(GetVaultArgs) 74 | r, err := GetVault(ctx, &args, opts...) 75 | var s GetVaultResult 76 | if r != nil { 77 | s = *r 78 | } 79 | return s, err 80 | }).(GetVaultResultOutput) 81 | } 82 | 83 | // A collection of arguments for invoking getVault. 84 | type GetVaultOutputArgs struct { 85 | // The name of the vault to retrieve. This field will be populated with the name of the vault if the vault it looked up by its UUID. 86 | Name pulumi.StringPtrInput `pulumi:"name"` 87 | // The UUID of the vault to retrieve. This field will be populated with the UUID of the vault if the vault it looked up by its name. 88 | Uuid pulumi.StringPtrInput `pulumi:"uuid"` 89 | } 90 | 91 | func (GetVaultOutputArgs) ElementType() reflect.Type { 92 | return reflect.TypeOf((*GetVaultArgs)(nil)).Elem() 93 | } 94 | 95 | // A collection of values returned by getVault. 96 | type GetVaultResultOutput struct{ *pulumi.OutputState } 97 | 98 | func (GetVaultResultOutput) ElementType() reflect.Type { 99 | return reflect.TypeOf((*GetVaultResult)(nil)).Elem() 100 | } 101 | 102 | func (o GetVaultResultOutput) ToGetVaultResultOutput() GetVaultResultOutput { 103 | return o 104 | } 105 | 106 | func (o GetVaultResultOutput) ToGetVaultResultOutputWithContext(ctx context.Context) GetVaultResultOutput { 107 | return o 108 | } 109 | 110 | // The description of the vault. 111 | func (o GetVaultResultOutput) Description() pulumi.StringOutput { 112 | return o.ApplyT(func(v GetVaultResult) string { return v.Description }).(pulumi.StringOutput) 113 | } 114 | 115 | func (o GetVaultResultOutput) Id() pulumi.StringOutput { 116 | return o.ApplyT(func(v GetVaultResult) string { return v.Id }).(pulumi.StringOutput) 117 | } 118 | 119 | // The name of the vault to retrieve. This field will be populated with the name of the vault if the vault it looked up by its UUID. 120 | func (o GetVaultResultOutput) Name() pulumi.StringOutput { 121 | return o.ApplyT(func(v GetVaultResult) string { return v.Name }).(pulumi.StringOutput) 122 | } 123 | 124 | // The UUID of the vault to retrieve. This field will be populated with the UUID of the vault if the vault it looked up by its name. 125 | func (o GetVaultResultOutput) Uuid() pulumi.StringOutput { 126 | return o.ApplyT(func(v GetVaultResult) string { return v.Uuid }).(pulumi.StringOutput) 127 | } 128 | 129 | func init() { 130 | pulumi.RegisterOutputType(GetVaultResultOutput{}) 131 | } 132 | -------------------------------------------------------------------------------- /sdk/go/onepassword/init.go: -------------------------------------------------------------------------------- 1 | // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. 2 | // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | package onepassword 5 | 6 | import ( 7 | "fmt" 8 | 9 | "github.com/1Password/pulumi-onepassword/sdk/go/onepassword/internal" 10 | "github.com/blang/semver" 11 | "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 12 | ) 13 | 14 | type module struct { 15 | version semver.Version 16 | } 17 | 18 | func (m *module) Version() semver.Version { 19 | return m.version 20 | } 21 | 22 | func (m *module) Construct(ctx *pulumi.Context, name, typ, urn string) (r pulumi.Resource, err error) { 23 | switch typ { 24 | case "onepassword:index/item:Item": 25 | r = &Item{} 26 | default: 27 | return nil, fmt.Errorf("unknown resource type: %s", typ) 28 | } 29 | 30 | err = ctx.RegisterResource(typ, name, nil, r, pulumi.URN_(urn)) 31 | return 32 | } 33 | 34 | type pkg struct { 35 | version semver.Version 36 | } 37 | 38 | func (p *pkg) Version() semver.Version { 39 | return p.version 40 | } 41 | 42 | func (p *pkg) ConstructProvider(ctx *pulumi.Context, name, typ, urn string) (pulumi.ProviderResource, error) { 43 | if typ != "pulumi:providers:onepassword" { 44 | return nil, fmt.Errorf("unknown provider type: %s", typ) 45 | } 46 | 47 | r := &Provider{} 48 | err := ctx.RegisterResource(typ, name, nil, r, pulumi.URN_(urn)) 49 | return r, err 50 | } 51 | 52 | func init() { 53 | version, err := internal.PkgVersion() 54 | if err != nil { 55 | version = semver.Version{Major: 1} 56 | } 57 | pulumi.RegisterResourceModule( 58 | "onepassword", 59 | "index/item", 60 | &module{version}, 61 | ) 62 | pulumi.RegisterResourcePackage( 63 | "onepassword", 64 | &pkg{version}, 65 | ) 66 | } 67 | -------------------------------------------------------------------------------- /sdk/go/onepassword/internal/pulumiUtilities.go: -------------------------------------------------------------------------------- 1 | // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. 2 | // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | package internal 5 | 6 | import ( 7 | "fmt" 8 | "os" 9 | "reflect" 10 | "regexp" 11 | "strconv" 12 | "strings" 13 | 14 | "github.com/blang/semver" 15 | "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 16 | ) 17 | 18 | import ( 19 | "github.com/pulumi/pulumi/sdk/v3/go/pulumi/internals" 20 | ) 21 | 22 | type envParser func(v string) interface{} 23 | 24 | func ParseEnvBool(v string) interface{} { 25 | b, err := strconv.ParseBool(v) 26 | if err != nil { 27 | return nil 28 | } 29 | return b 30 | } 31 | 32 | func ParseEnvInt(v string) interface{} { 33 | i, err := strconv.ParseInt(v, 0, 0) 34 | if err != nil { 35 | return nil 36 | } 37 | return int(i) 38 | } 39 | 40 | func ParseEnvFloat(v string) interface{} { 41 | f, err := strconv.ParseFloat(v, 64) 42 | if err != nil { 43 | return nil 44 | } 45 | return f 46 | } 47 | 48 | func ParseEnvStringArray(v string) interface{} { 49 | var result pulumi.StringArray 50 | for _, item := range strings.Split(v, ";") { 51 | result = append(result, pulumi.String(item)) 52 | } 53 | return result 54 | } 55 | 56 | func GetEnvOrDefault(def interface{}, parser envParser, vars ...string) interface{} { 57 | for _, v := range vars { 58 | if value, ok := os.LookupEnv(v); ok { 59 | if parser != nil { 60 | return parser(value) 61 | } 62 | return value 63 | } 64 | } 65 | return def 66 | } 67 | 68 | // PkgVersion uses reflection to determine the version of the current package. 69 | // If a version cannot be determined, v1 will be assumed. The second return 70 | // value is always nil. 71 | func PkgVersion() (semver.Version, error) { 72 | // emptyVersion defaults to v0.0.0 73 | if !SdkVersion.Equals(semver.Version{}) { 74 | return SdkVersion, nil 75 | } 76 | type sentinal struct{} 77 | pkgPath := reflect.TypeOf(sentinal{}).PkgPath() 78 | re := regexp.MustCompile("^.*/pulumi-onepassword/sdk(/v\\d+)?") 79 | if match := re.FindStringSubmatch(pkgPath); match != nil { 80 | vStr := match[1] 81 | if len(vStr) == 0 { // If the version capture group was empty, default to v1. 82 | return semver.Version{Major: 1}, nil 83 | } 84 | return semver.MustParse(fmt.Sprintf("%s.0.0", vStr[2:])), nil 85 | } 86 | return semver.Version{Major: 1}, nil 87 | } 88 | 89 | // isZero is a null safe check for if a value is it's types zero value. 90 | func IsZero(v interface{}) bool { 91 | if v == nil { 92 | return true 93 | } 94 | return reflect.ValueOf(v).IsZero() 95 | } 96 | 97 | func CallPlain( 98 | ctx *pulumi.Context, 99 | tok string, 100 | args pulumi.Input, 101 | output pulumi.Output, 102 | self pulumi.Resource, 103 | property string, 104 | resultPtr reflect.Value, 105 | errorPtr *error, 106 | opts ...pulumi.InvokeOption, 107 | ) { 108 | res, err := callPlainInner(ctx, tok, args, output, self, opts...) 109 | if err != nil { 110 | *errorPtr = err 111 | return 112 | } 113 | 114 | v := reflect.ValueOf(res) 115 | 116 | // extract res.property field if asked to do so 117 | if property != "" { 118 | v = v.FieldByName("Res") 119 | } 120 | 121 | // return by setting the result pointer; this style of returns shortens the generated code without generics 122 | resultPtr.Elem().Set(v) 123 | } 124 | 125 | func callPlainInner( 126 | ctx *pulumi.Context, 127 | tok string, 128 | args pulumi.Input, 129 | output pulumi.Output, 130 | self pulumi.Resource, 131 | opts ...pulumi.InvokeOption, 132 | ) (any, error) { 133 | o, err := ctx.Call(tok, args, output, self, opts...) 134 | if err != nil { 135 | return nil, err 136 | } 137 | 138 | outputData, err := internals.UnsafeAwaitOutput(ctx.Context(), o) 139 | if err != nil { 140 | return nil, err 141 | } 142 | 143 | // Ingoring deps silently. They are typically non-empty, r.f() calls include r as a dependency. 144 | known := outputData.Known 145 | value := outputData.Value 146 | secret := outputData.Secret 147 | 148 | problem := "" 149 | if !known { 150 | problem = "an unknown value" 151 | } else if secret { 152 | problem = "a secret value" 153 | } 154 | 155 | if problem != "" { 156 | return nil, fmt.Errorf("Plain resource method %q incorrectly returned %s. "+ 157 | "This is an error in the provider, please report this to the provider developer.", 158 | tok, problem) 159 | } 160 | 161 | return value, nil 162 | } 163 | 164 | // PkgResourceDefaultOpts provides package level defaults to pulumi.OptionResource. 165 | func PkgResourceDefaultOpts(opts []pulumi.ResourceOption) []pulumi.ResourceOption { 166 | defaults := []pulumi.ResourceOption{} 167 | defaults = append(defaults, pulumi.PluginDownloadURL("github://api.github.com/1Password/pulumi-onepassword")) 168 | version := SdkVersion 169 | if !version.Equals(semver.Version{}) { 170 | defaults = append(defaults, pulumi.Version(version.String())) 171 | } 172 | return append(defaults, opts...) 173 | } 174 | 175 | // PkgInvokeDefaultOpts provides package level defaults to pulumi.OptionInvoke. 176 | func PkgInvokeDefaultOpts(opts []pulumi.InvokeOption) []pulumi.InvokeOption { 177 | defaults := []pulumi.InvokeOption{} 178 | defaults = append(defaults, pulumi.PluginDownloadURL("github://api.github.com/1Password/pulumi-onepassword")) 179 | version := SdkVersion 180 | if !version.Equals(semver.Version{}) { 181 | defaults = append(defaults, pulumi.Version(version.String())) 182 | } 183 | return append(defaults, opts...) 184 | } 185 | -------------------------------------------------------------------------------- /sdk/go/onepassword/internal/pulumiVersion.go: -------------------------------------------------------------------------------- 1 | // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. 2 | // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | package internal 5 | 6 | import ( 7 | "github.com/blang/semver" 8 | ) 9 | 10 | var SdkVersion semver.Version = semver.Version{} 11 | var pluginDownloadURL string = "" 12 | -------------------------------------------------------------------------------- /sdk/go/onepassword/provider.go: -------------------------------------------------------------------------------- 1 | // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. 2 | // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | package onepassword 5 | 6 | import ( 7 | "context" 8 | "reflect" 9 | 10 | "github.com/1Password/pulumi-onepassword/sdk/go/onepassword/internal" 11 | "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 12 | ) 13 | 14 | // The provider type for the onepassword package. By default, resources use package-wide configuration 15 | // settings, however an explicit `Provider` instance may be created and passed during resource 16 | // construction to achieve fine-grained programmatic control over provider settings. See the 17 | // [documentation](https://www.pulumi.com/docs/reference/programming-model/#providers) for more information. 18 | type Provider struct { 19 | pulumi.ProviderResourceState 20 | 21 | // A valid account's sign-in address or ID to use biometrics unlock. Can also be sourced from `OP_ACCOUNT` environment 22 | // variable. Provider will use the 1Password CLI if set. 23 | Account pulumi.StringPtrOutput `pulumi:"account"` 24 | // The path to the 1Password CLI binary. Can also be sourced from `OP_CLI_PATH` environment variable. Defaults to `op`. 25 | OpCliPath pulumi.StringPtrOutput `pulumi:"opCliPath"` 26 | // A valid 1Password service account token. Can also be sourced from `OP_SERVICE_ACCOUNT_TOKEN` environment variable. 27 | // Provider will use the 1Password CLI if set. 28 | ServiceAccountToken pulumi.StringPtrOutput `pulumi:"serviceAccountToken"` 29 | // A valid token for your 1Password Connect server. Can also be sourced from `OP_CONNECT_TOKEN` environment variable. 30 | // Provider will use 1Password Connect server if set. 31 | Token pulumi.StringPtrOutput `pulumi:"token"` 32 | // The HTTP(S) URL where your 1Password Connect server can be found. Can also be sourced `OP_CONNECT_HOST` environment 33 | // variable. Provider will use 1Password Connect server if set. 34 | Url pulumi.StringPtrOutput `pulumi:"url"` 35 | } 36 | 37 | // NewProvider registers a new resource with the given unique name, arguments, and options. 38 | func NewProvider(ctx *pulumi.Context, 39 | name string, args *ProviderArgs, opts ...pulumi.ResourceOption) (*Provider, error) { 40 | if args == nil { 41 | args = &ProviderArgs{} 42 | } 43 | 44 | if args.Account == nil { 45 | if d := internal.GetEnvOrDefault(nil, nil, "OP_ACCOUNT"); d != nil { 46 | args.Account = pulumi.StringPtr(d.(string)) 47 | } 48 | } 49 | if args.OpCliPath == nil { 50 | if d := internal.GetEnvOrDefault(nil, nil, "OP_CLI_PATH"); d != nil { 51 | args.OpCliPath = pulumi.StringPtr(d.(string)) 52 | } 53 | } 54 | if args.ServiceAccountToken == nil { 55 | if d := internal.GetEnvOrDefault(nil, nil, "OP_SERVICE_ACCOUNT_TOKEN"); d != nil { 56 | args.ServiceAccountToken = pulumi.StringPtr(d.(string)) 57 | } 58 | } 59 | if args.Token == nil { 60 | if d := internal.GetEnvOrDefault(nil, nil, "OP_CONNECT_TOKEN"); d != nil { 61 | args.Token = pulumi.StringPtr(d.(string)) 62 | } 63 | } 64 | if args.Url == nil { 65 | if d := internal.GetEnvOrDefault(nil, nil, "OP_CONNECT_HOST"); d != nil { 66 | args.Url = pulumi.StringPtr(d.(string)) 67 | } 68 | } 69 | if args.ServiceAccountToken != nil { 70 | args.ServiceAccountToken = pulumi.ToSecret(args.ServiceAccountToken).(pulumi.StringPtrInput) 71 | } 72 | if args.Token != nil { 73 | args.Token = pulumi.ToSecret(args.Token).(pulumi.StringPtrInput) 74 | } 75 | secrets := pulumi.AdditionalSecretOutputs([]string{ 76 | "serviceAccountToken", 77 | "token", 78 | }) 79 | opts = append(opts, secrets) 80 | opts = internal.PkgResourceDefaultOpts(opts) 81 | var resource Provider 82 | err := ctx.RegisterResource("pulumi:providers:onepassword", name, args, &resource, opts...) 83 | if err != nil { 84 | return nil, err 85 | } 86 | return &resource, nil 87 | } 88 | 89 | type providerArgs struct { 90 | // A valid account's sign-in address or ID to use biometrics unlock. Can also be sourced from `OP_ACCOUNT` environment 91 | // variable. Provider will use the 1Password CLI if set. 92 | Account *string `pulumi:"account"` 93 | // The path to the 1Password CLI binary. Can also be sourced from `OP_CLI_PATH` environment variable. Defaults to `op`. 94 | OpCliPath *string `pulumi:"opCliPath"` 95 | // A valid 1Password service account token. Can also be sourced from `OP_SERVICE_ACCOUNT_TOKEN` environment variable. 96 | // Provider will use the 1Password CLI if set. 97 | ServiceAccountToken *string `pulumi:"serviceAccountToken"` 98 | // A valid token for your 1Password Connect server. Can also be sourced from `OP_CONNECT_TOKEN` environment variable. 99 | // Provider will use 1Password Connect server if set. 100 | Token *string `pulumi:"token"` 101 | // The HTTP(S) URL where your 1Password Connect server can be found. Can also be sourced `OP_CONNECT_HOST` environment 102 | // variable. Provider will use 1Password Connect server if set. 103 | Url *string `pulumi:"url"` 104 | } 105 | 106 | // The set of arguments for constructing a Provider resource. 107 | type ProviderArgs struct { 108 | // A valid account's sign-in address or ID to use biometrics unlock. Can also be sourced from `OP_ACCOUNT` environment 109 | // variable. Provider will use the 1Password CLI if set. 110 | Account pulumi.StringPtrInput 111 | // The path to the 1Password CLI binary. Can also be sourced from `OP_CLI_PATH` environment variable. Defaults to `op`. 112 | OpCliPath pulumi.StringPtrInput 113 | // A valid 1Password service account token. Can also be sourced from `OP_SERVICE_ACCOUNT_TOKEN` environment variable. 114 | // Provider will use the 1Password CLI if set. 115 | ServiceAccountToken pulumi.StringPtrInput 116 | // A valid token for your 1Password Connect server. Can also be sourced from `OP_CONNECT_TOKEN` environment variable. 117 | // Provider will use 1Password Connect server if set. 118 | Token pulumi.StringPtrInput 119 | // The HTTP(S) URL where your 1Password Connect server can be found. Can also be sourced `OP_CONNECT_HOST` environment 120 | // variable. Provider will use 1Password Connect server if set. 121 | Url pulumi.StringPtrInput 122 | } 123 | 124 | func (ProviderArgs) ElementType() reflect.Type { 125 | return reflect.TypeOf((*providerArgs)(nil)).Elem() 126 | } 127 | 128 | type ProviderInput interface { 129 | pulumi.Input 130 | 131 | ToProviderOutput() ProviderOutput 132 | ToProviderOutputWithContext(ctx context.Context) ProviderOutput 133 | } 134 | 135 | func (*Provider) ElementType() reflect.Type { 136 | return reflect.TypeOf((**Provider)(nil)).Elem() 137 | } 138 | 139 | func (i *Provider) ToProviderOutput() ProviderOutput { 140 | return i.ToProviderOutputWithContext(context.Background()) 141 | } 142 | 143 | func (i *Provider) ToProviderOutputWithContext(ctx context.Context) ProviderOutput { 144 | return pulumi.ToOutputWithContext(ctx, i).(ProviderOutput) 145 | } 146 | 147 | type ProviderOutput struct{ *pulumi.OutputState } 148 | 149 | func (ProviderOutput) ElementType() reflect.Type { 150 | return reflect.TypeOf((**Provider)(nil)).Elem() 151 | } 152 | 153 | func (o ProviderOutput) ToProviderOutput() ProviderOutput { 154 | return o 155 | } 156 | 157 | func (o ProviderOutput) ToProviderOutputWithContext(ctx context.Context) ProviderOutput { 158 | return o 159 | } 160 | 161 | // A valid account's sign-in address or ID to use biometrics unlock. Can also be sourced from `OP_ACCOUNT` environment 162 | // variable. Provider will use the 1Password CLI if set. 163 | func (o ProviderOutput) Account() pulumi.StringPtrOutput { 164 | return o.ApplyT(func(v *Provider) pulumi.StringPtrOutput { return v.Account }).(pulumi.StringPtrOutput) 165 | } 166 | 167 | // The path to the 1Password CLI binary. Can also be sourced from `OP_CLI_PATH` environment variable. Defaults to `op`. 168 | func (o ProviderOutput) OpCliPath() pulumi.StringPtrOutput { 169 | return o.ApplyT(func(v *Provider) pulumi.StringPtrOutput { return v.OpCliPath }).(pulumi.StringPtrOutput) 170 | } 171 | 172 | // A valid 1Password service account token. Can also be sourced from `OP_SERVICE_ACCOUNT_TOKEN` environment variable. 173 | // Provider will use the 1Password CLI if set. 174 | func (o ProviderOutput) ServiceAccountToken() pulumi.StringPtrOutput { 175 | return o.ApplyT(func(v *Provider) pulumi.StringPtrOutput { return v.ServiceAccountToken }).(pulumi.StringPtrOutput) 176 | } 177 | 178 | // A valid token for your 1Password Connect server. Can also be sourced from `OP_CONNECT_TOKEN` environment variable. 179 | // Provider will use 1Password Connect server if set. 180 | func (o ProviderOutput) Token() pulumi.StringPtrOutput { 181 | return o.ApplyT(func(v *Provider) pulumi.StringPtrOutput { return v.Token }).(pulumi.StringPtrOutput) 182 | } 183 | 184 | // The HTTP(S) URL where your 1Password Connect server can be found. Can also be sourced `OP_CONNECT_HOST` environment 185 | // variable. Provider will use 1Password Connect server if set. 186 | func (o ProviderOutput) Url() pulumi.StringPtrOutput { 187 | return o.ApplyT(func(v *Provider) pulumi.StringPtrOutput { return v.Url }).(pulumi.StringPtrOutput) 188 | } 189 | 190 | func init() { 191 | pulumi.RegisterInputType(reflect.TypeOf((*ProviderInput)(nil)).Elem(), &Provider{}) 192 | pulumi.RegisterOutputType(ProviderOutput{}) 193 | } 194 | -------------------------------------------------------------------------------- /sdk/go/onepassword/pulumi-plugin.json: -------------------------------------------------------------------------------- 1 | { 2 | "resource": true, 3 | "name": "onepassword", 4 | "server": "github://api.github.com/1Password/pulumi-onepassword" 5 | } 6 | -------------------------------------------------------------------------------- /sdk/nodejs/Pulumi.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1Password/pulumi-onepassword/559bf4f66874e6ac6875fdb08cfe71ab0b98b273/sdk/nodejs/Pulumi.yaml -------------------------------------------------------------------------------- /sdk/nodejs/README.md: -------------------------------------------------------------------------------- 1 | > This provider is a derived work of the [Terraform Provider](https://github.com/1Password/terraform-provider-onepassword) 2 | > distributed under [MPL 2.0](https://www.mozilla.org/en-US/MPL/2.0/). If you encounter a bug or missing feature, 3 | > first check the [`pulumi-onepassword` repo](https://github.com/1Password/pulumi-onepassword/issues); however, if that doesn't turn up anything, 4 | > please consult the source [`terraform-provider-onepassword` repo](https://github.com/1Password/terraform-provider-onepassword/issues). 5 | -------------------------------------------------------------------------------- /sdk/nodejs/config/index.ts: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | // Export members: 5 | export * from "./vars"; 6 | -------------------------------------------------------------------------------- /sdk/nodejs/config/vars.ts: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | import * as pulumi from "@pulumi/pulumi"; 5 | import * as utilities from "../utilities"; 6 | 7 | declare var exports: any; 8 | const __config = new pulumi.Config("onepassword"); 9 | 10 | /** 11 | * A valid account's sign-in address or ID to use biometrics unlock. Can also be sourced from `OP_ACCOUNT` environment 12 | * variable. Provider will use the 1Password CLI if set. 13 | */ 14 | export declare const account: string | undefined; 15 | Object.defineProperty(exports, "account", { 16 | get() { 17 | return __config.get("account") ?? utilities.getEnv("OP_ACCOUNT"); 18 | }, 19 | enumerable: true, 20 | }); 21 | 22 | /** 23 | * The path to the 1Password CLI binary. Can also be sourced from `OP_CLI_PATH` environment variable. Defaults to `op`. 24 | */ 25 | export declare const opCliPath: string | undefined; 26 | Object.defineProperty(exports, "opCliPath", { 27 | get() { 28 | return __config.get("opCliPath") ?? utilities.getEnv("OP_CLI_PATH"); 29 | }, 30 | enumerable: true, 31 | }); 32 | 33 | /** 34 | * A valid 1Password service account token. Can also be sourced from `OP_SERVICE_ACCOUNT_TOKEN` environment variable. 35 | * Provider will use the 1Password CLI if set. 36 | */ 37 | export declare const serviceAccountToken: string | undefined; 38 | Object.defineProperty(exports, "serviceAccountToken", { 39 | get() { 40 | return __config.get("serviceAccountToken") ?? utilities.getEnv("OP_SERVICE_ACCOUNT_TOKEN"); 41 | }, 42 | enumerable: true, 43 | }); 44 | 45 | /** 46 | * A valid token for your 1Password Connect server. Can also be sourced from `OP_CONNECT_TOKEN` environment variable. 47 | * Provider will use 1Password Connect server if set. 48 | */ 49 | export declare const token: string | undefined; 50 | Object.defineProperty(exports, "token", { 51 | get() { 52 | return __config.get("token") ?? utilities.getEnv("OP_CONNECT_TOKEN"); 53 | }, 54 | enumerable: true, 55 | }); 56 | 57 | /** 58 | * The HTTP(S) URL where your 1Password Connect server can be found. Can also be sourced `OP_CONNECT_HOST` environment 59 | * variable. Provider will use 1Password Connect server if set. 60 | */ 61 | export declare const url: string | undefined; 62 | Object.defineProperty(exports, "url", { 63 | get() { 64 | return __config.get("url") ?? utilities.getEnv("OP_CONNECT_HOST"); 65 | }, 66 | enumerable: true, 67 | }); 68 | 69 | -------------------------------------------------------------------------------- /sdk/nodejs/getItem.ts: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | import * as pulumi from "@pulumi/pulumi"; 5 | import * as inputs from "./types/input"; 6 | import * as outputs from "./types/output"; 7 | import * as utilities from "./utilities"; 8 | 9 | /** 10 | * Use this data source to get details of an item by its vault uuid and either the title or the uuid of the item. 11 | * 12 | * ## Example Usage 13 | * 14 | * ```typescript 15 | * import * as pulumi from "@pulumi/pulumi"; 16 | * import * as onepassword from "@1Password/pulumi-onepassword"; 17 | * 18 | * const example = onepassword.getItem({ 19 | * title: "your-item-title", 20 | * vault: "your-vault-id", 21 | * }); 22 | * ``` 23 | */ 24 | export function getItem(args: GetItemArgs, opts?: pulumi.InvokeOptions): Promise { 25 | 26 | opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); 27 | return pulumi.runtime.invoke("onepassword:index/getItem:getItem", { 28 | "files": args.files, 29 | "noteValue": args.noteValue, 30 | "sections": args.sections, 31 | "title": args.title, 32 | "uuid": args.uuid, 33 | "vault": args.vault, 34 | }, opts); 35 | } 36 | 37 | /** 38 | * A collection of arguments for invoking getItem. 39 | */ 40 | export interface GetItemArgs { 41 | /** 42 | * A list of files attached to the item. 43 | */ 44 | files?: inputs.GetItemFile[]; 45 | /** 46 | * Secure Note value. 47 | */ 48 | noteValue?: string; 49 | /** 50 | * A list of custom sections in an item 51 | */ 52 | sections?: inputs.GetItemSection[]; 53 | /** 54 | * The title of the item to retrieve. This field will be populated with the title of the item if the item it looked up by its UUID. 55 | */ 56 | title?: string; 57 | /** 58 | * The UUID of the item to retrieve. This field will be populated with the UUID of the item if the item it looked up by its title. 59 | */ 60 | uuid?: string; 61 | /** 62 | * The UUID of the vault the item is in. 63 | */ 64 | vault: string; 65 | } 66 | 67 | /** 68 | * A collection of values returned by getItem. 69 | */ 70 | export interface GetItemResult { 71 | /** 72 | * The category of the item. One of ["login" "password" "database" "secure*note" "document" "ssh*key"] 73 | */ 74 | readonly category: string; 75 | /** 76 | * API credential for this item. 77 | */ 78 | readonly credential: string; 79 | /** 80 | * (Only applies to the database category) The name of the database. 81 | */ 82 | readonly database: string; 83 | /** 84 | * A list of files attached to the item. 85 | */ 86 | readonly files?: outputs.GetItemFile[]; 87 | /** 88 | * (Only applies to the database category) The address where the database can be found 89 | */ 90 | readonly hostname: string; 91 | readonly id: string; 92 | /** 93 | * Secure Note value. 94 | */ 95 | readonly noteValue: string; 96 | /** 97 | * Password for this item. 98 | */ 99 | readonly password: string; 100 | /** 101 | * (Only applies to the database category) The port the database is listening on. 102 | */ 103 | readonly port: string; 104 | /** 105 | * SSH Private Key for this item. 106 | */ 107 | readonly privateKey: string; 108 | /** 109 | * SSH Public Key for this item. 110 | */ 111 | readonly publicKey: string; 112 | /** 113 | * A list of custom sections in an item 114 | */ 115 | readonly sections?: outputs.GetItemSection[]; 116 | /** 117 | * An array of strings of the tags assigned to the item. 118 | */ 119 | readonly tags: string[]; 120 | /** 121 | * The title of the item to retrieve. This field will be populated with the title of the item if the item it looked up by its UUID. 122 | */ 123 | readonly title: string; 124 | /** 125 | * (Only applies to the database category) The type of database. One of ["db2" "filemaker" "msaccess" "mssql" "mysql" "oracle" "postgresql" "sqlite" "other"] 126 | */ 127 | readonly type: string; 128 | /** 129 | * The primary URL for the item. 130 | */ 131 | readonly url: string; 132 | /** 133 | * Username for this item. 134 | */ 135 | readonly username: string; 136 | /** 137 | * The UUID of the item to retrieve. This field will be populated with the UUID of the item if the item it looked up by its title. 138 | */ 139 | readonly uuid: string; 140 | /** 141 | * The UUID of the vault the item is in. 142 | */ 143 | readonly vault: string; 144 | } 145 | /** 146 | * Use this data source to get details of an item by its vault uuid and either the title or the uuid of the item. 147 | * 148 | * ## Example Usage 149 | * 150 | * ```typescript 151 | * import * as pulumi from "@pulumi/pulumi"; 152 | * import * as onepassword from "@1Password/pulumi-onepassword"; 153 | * 154 | * const example = onepassword.getItem({ 155 | * title: "your-item-title", 156 | * vault: "your-vault-id", 157 | * }); 158 | * ``` 159 | */ 160 | export function getItemOutput(args: GetItemOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { 161 | return pulumi.output(args).apply((a: any) => getItem(a, opts)) 162 | } 163 | 164 | /** 165 | * A collection of arguments for invoking getItem. 166 | */ 167 | export interface GetItemOutputArgs { 168 | /** 169 | * A list of files attached to the item. 170 | */ 171 | files?: pulumi.Input[]>; 172 | /** 173 | * Secure Note value. 174 | */ 175 | noteValue?: pulumi.Input; 176 | /** 177 | * A list of custom sections in an item 178 | */ 179 | sections?: pulumi.Input[]>; 180 | /** 181 | * The title of the item to retrieve. This field will be populated with the title of the item if the item it looked up by its UUID. 182 | */ 183 | title?: pulumi.Input; 184 | /** 185 | * The UUID of the item to retrieve. This field will be populated with the UUID of the item if the item it looked up by its title. 186 | */ 187 | uuid?: pulumi.Input; 188 | /** 189 | * The UUID of the vault the item is in. 190 | */ 191 | vault: pulumi.Input; 192 | } 193 | -------------------------------------------------------------------------------- /sdk/nodejs/getVault.ts: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | import * as pulumi from "@pulumi/pulumi"; 5 | import * as utilities from "./utilities"; 6 | 7 | /** 8 | * Use this data source to get details of a vault by either its name or uuid. 9 | * 10 | * ## Example Usage 11 | * 12 | * ```typescript 13 | * import * as pulumi from "@pulumi/pulumi"; 14 | * import * as onepassword from "@1Password/pulumi-onepassword"; 15 | * 16 | * const example = onepassword.getVault({ 17 | * name: "your-vault-name", 18 | * }); 19 | * ``` 20 | */ 21 | export function getVault(args?: GetVaultArgs, opts?: pulumi.InvokeOptions): Promise { 22 | args = args || {}; 23 | 24 | opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); 25 | return pulumi.runtime.invoke("onepassword:index/getVault:getVault", { 26 | "name": args.name, 27 | "uuid": args.uuid, 28 | }, opts); 29 | } 30 | 31 | /** 32 | * A collection of arguments for invoking getVault. 33 | */ 34 | export interface GetVaultArgs { 35 | /** 36 | * The name of the vault to retrieve. This field will be populated with the name of the vault if the vault it looked up by its UUID. 37 | */ 38 | name?: string; 39 | /** 40 | * The UUID of the vault to retrieve. This field will be populated with the UUID of the vault if the vault it looked up by its name. 41 | */ 42 | uuid?: string; 43 | } 44 | 45 | /** 46 | * A collection of values returned by getVault. 47 | */ 48 | export interface GetVaultResult { 49 | /** 50 | * The description of the vault. 51 | */ 52 | readonly description: string; 53 | readonly id: string; 54 | /** 55 | * The name of the vault to retrieve. This field will be populated with the name of the vault if the vault it looked up by its UUID. 56 | */ 57 | readonly name: string; 58 | /** 59 | * The UUID of the vault to retrieve. This field will be populated with the UUID of the vault if the vault it looked up by its name. 60 | */ 61 | readonly uuid: string; 62 | } 63 | /** 64 | * Use this data source to get details of a vault by either its name or uuid. 65 | * 66 | * ## Example Usage 67 | * 68 | * ```typescript 69 | * import * as pulumi from "@pulumi/pulumi"; 70 | * import * as onepassword from "@1Password/pulumi-onepassword"; 71 | * 72 | * const example = onepassword.getVault({ 73 | * name: "your-vault-name", 74 | * }); 75 | * ``` 76 | */ 77 | export function getVaultOutput(args?: GetVaultOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { 78 | return pulumi.output(args).apply((a: any) => getVault(a, opts)) 79 | } 80 | 81 | /** 82 | * A collection of arguments for invoking getVault. 83 | */ 84 | export interface GetVaultOutputArgs { 85 | /** 86 | * The name of the vault to retrieve. This field will be populated with the name of the vault if the vault it looked up by its UUID. 87 | */ 88 | name?: pulumi.Input; 89 | /** 90 | * The UUID of the vault to retrieve. This field will be populated with the UUID of the vault if the vault it looked up by its name. 91 | */ 92 | uuid?: pulumi.Input; 93 | } 94 | -------------------------------------------------------------------------------- /sdk/nodejs/index.ts: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | import * as pulumi from "@pulumi/pulumi"; 5 | import * as utilities from "./utilities"; 6 | 7 | // Export members: 8 | export { GetItemArgs, GetItemResult, GetItemOutputArgs } from "./getItem"; 9 | export const getItem: typeof import("./getItem").getItem = null as any; 10 | export const getItemOutput: typeof import("./getItem").getItemOutput = null as any; 11 | utilities.lazyLoad(exports, ["getItem","getItemOutput"], () => require("./getItem")); 12 | 13 | export { GetVaultArgs, GetVaultResult, GetVaultOutputArgs } from "./getVault"; 14 | export const getVault: typeof import("./getVault").getVault = null as any; 15 | export const getVaultOutput: typeof import("./getVault").getVaultOutput = null as any; 16 | utilities.lazyLoad(exports, ["getVault","getVaultOutput"], () => require("./getVault")); 17 | 18 | export { ItemArgs, ItemState } from "./item"; 19 | export type Item = import("./item").Item; 20 | export const Item: typeof import("./item").Item = null as any; 21 | utilities.lazyLoad(exports, ["Item"], () => require("./item")); 22 | 23 | export { ProviderArgs } from "./provider"; 24 | export type Provider = import("./provider").Provider; 25 | export const Provider: typeof import("./provider").Provider = null as any; 26 | utilities.lazyLoad(exports, ["Provider"], () => require("./provider")); 27 | 28 | 29 | // Export sub-modules: 30 | import * as config from "./config"; 31 | import * as types from "./types"; 32 | 33 | export { 34 | config, 35 | types, 36 | }; 37 | 38 | const _module = { 39 | version: utilities.getVersion(), 40 | construct: (name: string, type: string, urn: string): pulumi.Resource => { 41 | switch (type) { 42 | case "onepassword:index/item:Item": 43 | return new Item(name, undefined, { urn }) 44 | default: 45 | throw new Error(`unknown resource type ${type}`); 46 | } 47 | }, 48 | }; 49 | pulumi.runtime.registerResourceModule("onepassword", "index/item", _module) 50 | pulumi.runtime.registerResourcePackage("onepassword", { 51 | version: utilities.getVersion(), 52 | constructProvider: (name: string, type: string, urn: string): pulumi.ProviderResource => { 53 | if (type !== "pulumi:providers:onepassword") { 54 | throw new Error(`unknown provider type ${type}`); 55 | } 56 | return new Provider(name, undefined, { urn }); 57 | }, 58 | }); 59 | -------------------------------------------------------------------------------- /sdk/nodejs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@1password/pulumi-onepassword", 3 | "version": "${VERSION}", 4 | "description": "Use the 1Password Pulumi provider to access and manage items in your 1Password vaults.", 5 | "keywords": [ 6 | "pulumi", 7 | "onepassword", 8 | "1Password", 9 | "category/cloud" 10 | ], 11 | "homepage": "https://www.developer.1password.com", 12 | "repository": "https://github.com/1Password/pulumi-onepassword", 13 | "license": "Apache-2.0", 14 | "scripts": { 15 | "build": "tsc" 16 | }, 17 | "dependencies": { 18 | "@pulumi/pulumi": "^3.0.0" 19 | }, 20 | "devDependencies": { 21 | "@types/mime": "^2.0.0", 22 | "@types/node": "^10.0.0", 23 | "typescript": "^4.3.5" 24 | }, 25 | "pulumi": { 26 | "resource": true, 27 | "name": "onepassword", 28 | "server": "github://api.github.com/1Password/pulumi-onepassword" 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /sdk/nodejs/provider.ts: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | import * as pulumi from "@pulumi/pulumi"; 5 | import * as utilities from "./utilities"; 6 | 7 | /** 8 | * The provider type for the onepassword package. By default, resources use package-wide configuration 9 | * settings, however an explicit `Provider` instance may be created and passed during resource 10 | * construction to achieve fine-grained programmatic control over provider settings. See the 11 | * [documentation](https://www.pulumi.com/docs/reference/programming-model/#providers) for more information. 12 | */ 13 | export class Provider extends pulumi.ProviderResource { 14 | /** @internal */ 15 | public static readonly __pulumiType = 'onepassword'; 16 | 17 | /** 18 | * Returns true if the given object is an instance of Provider. This is designed to work even 19 | * when multiple copies of the Pulumi SDK have been loaded into the same process. 20 | */ 21 | public static isInstance(obj: any): obj is Provider { 22 | if (obj === undefined || obj === null) { 23 | return false; 24 | } 25 | return obj['__pulumiType'] === "pulumi:providers:" + Provider.__pulumiType; 26 | } 27 | 28 | /** 29 | * A valid account's sign-in address or ID to use biometrics unlock. Can also be sourced from `OP_ACCOUNT` environment 30 | * variable. Provider will use the 1Password CLI if set. 31 | */ 32 | public readonly account!: pulumi.Output; 33 | /** 34 | * The path to the 1Password CLI binary. Can also be sourced from `OP_CLI_PATH` environment variable. Defaults to `op`. 35 | */ 36 | public readonly opCliPath!: pulumi.Output; 37 | /** 38 | * A valid 1Password service account token. Can also be sourced from `OP_SERVICE_ACCOUNT_TOKEN` environment variable. 39 | * Provider will use the 1Password CLI if set. 40 | */ 41 | public readonly serviceAccountToken!: pulumi.Output; 42 | /** 43 | * A valid token for your 1Password Connect server. Can also be sourced from `OP_CONNECT_TOKEN` environment variable. 44 | * Provider will use 1Password Connect server if set. 45 | */ 46 | public readonly token!: pulumi.Output; 47 | /** 48 | * The HTTP(S) URL where your 1Password Connect server can be found. Can also be sourced `OP_CONNECT_HOST` environment 49 | * variable. Provider will use 1Password Connect server if set. 50 | */ 51 | public readonly url!: pulumi.Output; 52 | 53 | /** 54 | * Create a Provider resource with the given unique name, arguments, and options. 55 | * 56 | * @param name The _unique_ name of the resource. 57 | * @param args The arguments to use to populate this resource's properties. 58 | * @param opts A bag of options that control this resource's behavior. 59 | */ 60 | constructor(name: string, args?: ProviderArgs, opts?: pulumi.ResourceOptions) { 61 | let resourceInputs: pulumi.Inputs = {}; 62 | opts = opts || {}; 63 | { 64 | resourceInputs["account"] = (args ? args.account : undefined) ?? utilities.getEnv("OP_ACCOUNT"); 65 | resourceInputs["opCliPath"] = (args ? args.opCliPath : undefined) ?? utilities.getEnv("OP_CLI_PATH"); 66 | resourceInputs["serviceAccountToken"] = (args?.serviceAccountToken ? pulumi.secret(args.serviceAccountToken) : undefined) ?? utilities.getEnv("OP_SERVICE_ACCOUNT_TOKEN"); 67 | resourceInputs["token"] = (args?.token ? pulumi.secret(args.token) : undefined) ?? utilities.getEnv("OP_CONNECT_TOKEN"); 68 | resourceInputs["url"] = (args ? args.url : undefined) ?? utilities.getEnv("OP_CONNECT_HOST"); 69 | } 70 | opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); 71 | const secretOpts = { additionalSecretOutputs: ["serviceAccountToken", "token"] }; 72 | opts = pulumi.mergeOptions(opts, secretOpts); 73 | super(Provider.__pulumiType, name, resourceInputs, opts); 74 | } 75 | } 76 | 77 | /** 78 | * The set of arguments for constructing a Provider resource. 79 | */ 80 | export interface ProviderArgs { 81 | /** 82 | * A valid account's sign-in address or ID to use biometrics unlock. Can also be sourced from `OP_ACCOUNT` environment 83 | * variable. Provider will use the 1Password CLI if set. 84 | */ 85 | account?: pulumi.Input; 86 | /** 87 | * The path to the 1Password CLI binary. Can also be sourced from `OP_CLI_PATH` environment variable. Defaults to `op`. 88 | */ 89 | opCliPath?: pulumi.Input; 90 | /** 91 | * A valid 1Password service account token. Can also be sourced from `OP_SERVICE_ACCOUNT_TOKEN` environment variable. 92 | * Provider will use the 1Password CLI if set. 93 | */ 94 | serviceAccountToken?: pulumi.Input; 95 | /** 96 | * A valid token for your 1Password Connect server. Can also be sourced from `OP_CONNECT_TOKEN` environment variable. 97 | * Provider will use 1Password Connect server if set. 98 | */ 99 | token?: pulumi.Input; 100 | /** 101 | * The HTTP(S) URL where your 1Password Connect server can be found. Can also be sourced `OP_CONNECT_HOST` environment 102 | * variable. Provider will use 1Password Connect server if set. 103 | */ 104 | url?: pulumi.Input; 105 | } 106 | -------------------------------------------------------------------------------- /sdk/nodejs/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "outDir": "bin", 4 | "target": "es2016", 5 | "module": "commonjs", 6 | "moduleResolution": "node", 7 | "declaration": true, 8 | "sourceMap": true, 9 | "stripInternal": true, 10 | "experimentalDecorators": true, 11 | "noFallthroughCasesInSwitch": true, 12 | "forceConsistentCasingInFileNames": true, 13 | "strict": true 14 | }, 15 | "files": [ 16 | "config/index.ts", 17 | "config/vars.ts", 18 | "getItem.ts", 19 | "getVault.ts", 20 | "index.ts", 21 | "item.ts", 22 | "provider.ts", 23 | "types/index.ts", 24 | "types/input.ts", 25 | "types/output.ts", 26 | "utilities.ts" 27 | ] 28 | } 29 | -------------------------------------------------------------------------------- /sdk/nodejs/types/index.ts: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | import * as utilities from "../utilities"; 5 | 6 | // Export sub-modules: 7 | import * as input from "./input"; 8 | import * as output from "./output"; 9 | 10 | export { 11 | input, 12 | output, 13 | }; 14 | -------------------------------------------------------------------------------- /sdk/nodejs/types/input.ts: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | import * as pulumi from "@pulumi/pulumi"; 5 | import * as inputs from "../types/input"; 6 | import * as outputs from "../types/output"; 7 | 8 | export interface GetItemFile { 9 | /** 10 | * The content of the file. 11 | */ 12 | content?: string; 13 | /** 14 | * The content of the file in base64 encoding. (Use this for binary files.) 15 | */ 16 | contentBase64?: string; 17 | /** 18 | * The UUID of the file. 19 | */ 20 | id?: string; 21 | /** 22 | * The name of the file. 23 | */ 24 | name?: string; 25 | } 26 | 27 | export interface GetItemFileArgs { 28 | /** 29 | * The content of the file. 30 | */ 31 | content?: pulumi.Input; 32 | /** 33 | * The content of the file in base64 encoding. (Use this for binary files.) 34 | */ 35 | contentBase64?: pulumi.Input; 36 | /** 37 | * The UUID of the file. 38 | */ 39 | id?: pulumi.Input; 40 | /** 41 | * The name of the file. 42 | */ 43 | name?: pulumi.Input; 44 | } 45 | 46 | export interface GetItemSection { 47 | fields?: inputs.GetItemSectionField[]; 48 | /** 49 | * A list of files attached to the section. 50 | */ 51 | files?: inputs.GetItemSectionFile[]; 52 | /** 53 | * A unique identifier for the section. 54 | */ 55 | id?: string; 56 | /** 57 | * The label for the section. 58 | */ 59 | label?: string; 60 | } 61 | 62 | export interface GetItemSectionArgs { 63 | fields?: pulumi.Input[]>; 64 | /** 65 | * A list of files attached to the section. 66 | */ 67 | files?: pulumi.Input[]>; 68 | /** 69 | * A unique identifier for the section. 70 | */ 71 | id?: pulumi.Input; 72 | /** 73 | * The label for the section. 74 | */ 75 | label?: pulumi.Input; 76 | } 77 | 78 | export interface GetItemSectionField { 79 | /** 80 | * A unique identifier for the field. 81 | */ 82 | id?: string; 83 | /** 84 | * The label for the field. 85 | */ 86 | label?: string; 87 | /** 88 | * Purpose indicates this is a special field: a username, password, or notes field. One of ["USERNAME" "PASSWORD" "NOTES"] 89 | */ 90 | purpose?: string; 91 | /** 92 | * The type of value stored in the field. One of ["STRING" "CONCEALED" "EMAIL" "URL" "OTP" "DATE" "MONTH_YEAR" "MENU"] 93 | */ 94 | type?: string; 95 | /** 96 | * The value of the field. 97 | */ 98 | value?: string; 99 | } 100 | 101 | export interface GetItemSectionFieldArgs { 102 | /** 103 | * A unique identifier for the field. 104 | */ 105 | id?: pulumi.Input; 106 | /** 107 | * The label for the field. 108 | */ 109 | label?: pulumi.Input; 110 | /** 111 | * Purpose indicates this is a special field: a username, password, or notes field. One of ["USERNAME" "PASSWORD" "NOTES"] 112 | */ 113 | purpose?: pulumi.Input; 114 | /** 115 | * The type of value stored in the field. One of ["STRING" "CONCEALED" "EMAIL" "URL" "OTP" "DATE" "MONTH_YEAR" "MENU"] 116 | */ 117 | type?: pulumi.Input; 118 | /** 119 | * The value of the field. 120 | */ 121 | value?: pulumi.Input; 122 | } 123 | 124 | export interface GetItemSectionFile { 125 | /** 126 | * The content of the file. 127 | */ 128 | content?: string; 129 | /** 130 | * The content of the file in base64 encoding. (Use this for binary files.) 131 | */ 132 | contentBase64?: string; 133 | /** 134 | * The UUID of the file. 135 | */ 136 | id?: string; 137 | /** 138 | * The name of the file. 139 | */ 140 | name?: string; 141 | } 142 | 143 | export interface GetItemSectionFileArgs { 144 | /** 145 | * The content of the file. 146 | */ 147 | content?: pulumi.Input; 148 | /** 149 | * The content of the file in base64 encoding. (Use this for binary files.) 150 | */ 151 | contentBase64?: pulumi.Input; 152 | /** 153 | * The UUID of the file. 154 | */ 155 | id?: pulumi.Input; 156 | /** 157 | * The name of the file. 158 | */ 159 | name?: pulumi.Input; 160 | } 161 | 162 | export interface ItemPasswordRecipe { 163 | /** 164 | * Use digits [0-9] when generating the password. 165 | */ 166 | digits?: pulumi.Input; 167 | /** 168 | * The length of the password to be generated. 169 | */ 170 | length?: pulumi.Input; 171 | /** 172 | * Use letters [a-zA-Z] when generating the password. 173 | */ 174 | letters?: pulumi.Input; 175 | /** 176 | * Use symbols [!@.-_*] when generating the password. 177 | */ 178 | symbols?: pulumi.Input; 179 | } 180 | 181 | export interface ItemSection { 182 | /** 183 | * A list of custom fields in the section. 184 | */ 185 | fields?: pulumi.Input[]>; 186 | /** 187 | * A unique identifier for the section. 188 | */ 189 | id?: pulumi.Input; 190 | /** 191 | * The label for the section. 192 | */ 193 | label: pulumi.Input; 194 | } 195 | 196 | export interface ItemSectionField { 197 | /** 198 | * A unique identifier for the field. 199 | */ 200 | id?: pulumi.Input; 201 | /** 202 | * The label for the field. 203 | */ 204 | label: pulumi.Input; 205 | /** 206 | * The recipe used to generate a new value for a password. 207 | */ 208 | passwordRecipe?: pulumi.Input; 209 | /** 210 | * Purpose indicates this is a special field: a username, password, or notes field. One of ["USERNAME" "PASSWORD" "NOTES"] 211 | */ 212 | purpose?: pulumi.Input; 213 | /** 214 | * The type of value stored in the field. One of ["STRING" "CONCEALED" "EMAIL" "URL" "OTP" "DATE" "MONTH_YEAR" "MENU"] 215 | */ 216 | type?: pulumi.Input; 217 | /** 218 | * The value of the field. 219 | */ 220 | value?: pulumi.Input; 221 | } 222 | 223 | export interface ItemSectionFieldPasswordRecipe { 224 | /** 225 | * Use digits [0-9] when generating the password. 226 | */ 227 | digits?: pulumi.Input; 228 | /** 229 | * The length of the password to be generated. 230 | */ 231 | length?: pulumi.Input; 232 | /** 233 | * Use letters [a-zA-Z] when generating the password. 234 | */ 235 | letters?: pulumi.Input; 236 | /** 237 | * Use symbols [!@.-_*] when generating the password. 238 | */ 239 | symbols?: pulumi.Input; 240 | } 241 | -------------------------------------------------------------------------------- /sdk/nodejs/types/output.ts: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | import * as pulumi from "@pulumi/pulumi"; 5 | import * as inputs from "../types/input"; 6 | import * as outputs from "../types/output"; 7 | 8 | export interface GetItemFile { 9 | /** 10 | * The content of the file. 11 | */ 12 | content: string; 13 | /** 14 | * The content of the file in base64 encoding. (Use this for binary files.) 15 | */ 16 | contentBase64: string; 17 | /** 18 | * The UUID of the file. 19 | */ 20 | id: string; 21 | /** 22 | * The name of the file. 23 | */ 24 | name: string; 25 | } 26 | 27 | export interface GetItemSection { 28 | fields?: outputs.GetItemSectionField[]; 29 | /** 30 | * A list of files attached to the section. 31 | */ 32 | files?: outputs.GetItemSectionFile[]; 33 | /** 34 | * A unique identifier for the section. 35 | */ 36 | id: string; 37 | /** 38 | * The label for the section. 39 | */ 40 | label: string; 41 | } 42 | 43 | export interface GetItemSectionField { 44 | /** 45 | * A unique identifier for the field. 46 | */ 47 | id: string; 48 | /** 49 | * The label for the field. 50 | */ 51 | label: string; 52 | /** 53 | * Purpose indicates this is a special field: a username, password, or notes field. One of ["USERNAME" "PASSWORD" "NOTES"] 54 | */ 55 | purpose: string; 56 | /** 57 | * The type of value stored in the field. One of ["STRING" "CONCEALED" "EMAIL" "URL" "OTP" "DATE" "MONTH_YEAR" "MENU"] 58 | */ 59 | type: string; 60 | /** 61 | * The value of the field. 62 | */ 63 | value: string; 64 | } 65 | 66 | export interface GetItemSectionFile { 67 | /** 68 | * The content of the file. 69 | */ 70 | content: string; 71 | /** 72 | * The content of the file in base64 encoding. (Use this for binary files.) 73 | */ 74 | contentBase64: string; 75 | /** 76 | * The UUID of the file. 77 | */ 78 | id: string; 79 | /** 80 | * The name of the file. 81 | */ 82 | name: string; 83 | } 84 | 85 | export interface ItemPasswordRecipe { 86 | /** 87 | * Use digits [0-9] when generating the password. 88 | */ 89 | digits: boolean; 90 | /** 91 | * The length of the password to be generated. 92 | */ 93 | length: number; 94 | /** 95 | * Use letters [a-zA-Z] when generating the password. 96 | */ 97 | letters: boolean; 98 | /** 99 | * Use symbols [!@.-_*] when generating the password. 100 | */ 101 | symbols: boolean; 102 | } 103 | 104 | export interface ItemSection { 105 | /** 106 | * A list of custom fields in the section. 107 | */ 108 | fields?: outputs.ItemSectionField[]; 109 | /** 110 | * A unique identifier for the section. 111 | */ 112 | id: string; 113 | /** 114 | * The label for the section. 115 | */ 116 | label: string; 117 | } 118 | 119 | export interface ItemSectionField { 120 | /** 121 | * A unique identifier for the field. 122 | */ 123 | id: string; 124 | /** 125 | * The label for the field. 126 | */ 127 | label: string; 128 | /** 129 | * The recipe used to generate a new value for a password. 130 | */ 131 | passwordRecipe?: outputs.ItemSectionFieldPasswordRecipe; 132 | /** 133 | * Purpose indicates this is a special field: a username, password, or notes field. One of ["USERNAME" "PASSWORD" "NOTES"] 134 | */ 135 | purpose?: string; 136 | /** 137 | * The type of value stored in the field. One of ["STRING" "CONCEALED" "EMAIL" "URL" "OTP" "DATE" "MONTH_YEAR" "MENU"] 138 | */ 139 | type: string; 140 | /** 141 | * The value of the field. 142 | */ 143 | value: string; 144 | } 145 | 146 | export interface ItemSectionFieldPasswordRecipe { 147 | /** 148 | * Use digits [0-9] when generating the password. 149 | */ 150 | digits: boolean; 151 | /** 152 | * The length of the password to be generated. 153 | */ 154 | length: number; 155 | /** 156 | * Use letters [a-zA-Z] when generating the password. 157 | */ 158 | letters: boolean; 159 | /** 160 | * Use symbols [!@.-_*] when generating the password. 161 | */ 162 | symbols: boolean; 163 | } 164 | 165 | -------------------------------------------------------------------------------- /sdk/nodejs/utilities.ts: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | 5 | import * as runtime from "@pulumi/pulumi/runtime"; 6 | import * as pulumi from "@pulumi/pulumi"; 7 | 8 | export function getEnv(...vars: string[]): string | undefined { 9 | for (const v of vars) { 10 | const value = process.env[v]; 11 | if (value) { 12 | return value; 13 | } 14 | } 15 | return undefined; 16 | } 17 | 18 | export function getEnvBoolean(...vars: string[]): boolean | undefined { 19 | const s = getEnv(...vars); 20 | if (s !== undefined) { 21 | // NOTE: these values are taken from https://golang.org/src/strconv/atob.go?s=351:391#L1, which is what 22 | // Terraform uses internally when parsing boolean values. 23 | if (["1", "t", "T", "true", "TRUE", "True"].find(v => v === s) !== undefined) { 24 | return true; 25 | } 26 | if (["0", "f", "F", "false", "FALSE", "False"].find(v => v === s) !== undefined) { 27 | return false; 28 | } 29 | } 30 | return undefined; 31 | } 32 | 33 | export function getEnvNumber(...vars: string[]): number | undefined { 34 | const s = getEnv(...vars); 35 | if (s !== undefined) { 36 | const f = parseFloat(s); 37 | if (!isNaN(f)) { 38 | return f; 39 | } 40 | } 41 | return undefined; 42 | } 43 | 44 | export function getVersion(): string { 45 | let version = require('./package.json').version; 46 | // Node allows for the version to be prefixed by a "v", while semver doesn't. 47 | // If there is a v, strip it off. 48 | if (version.indexOf('v') === 0) { 49 | version = version.slice(1); 50 | } 51 | return version; 52 | } 53 | 54 | /** @internal */ 55 | export function resourceOptsDefaults(): any { 56 | return { version: getVersion(), pluginDownloadURL: "github://api.github.com/1Password/pulumi-onepassword" }; 57 | } 58 | 59 | /** @internal */ 60 | export function lazyLoad(exports: any, props: string[], loadModule: any) { 61 | for (let property of props) { 62 | Object.defineProperty(exports, property, { 63 | enumerable: true, 64 | get: function() { 65 | return loadModule()[property]; 66 | }, 67 | }); 68 | } 69 | } 70 | 71 | export async function callAsync( 72 | tok: string, 73 | props: pulumi.Inputs, 74 | res?: pulumi.Resource, 75 | opts?: {property?: string}, 76 | ): Promise { 77 | const o: any = runtime.call(tok, props, res); 78 | const value = await o.promise(true /*withUnknowns*/); 79 | const isKnown = await o.isKnown; 80 | const isSecret = await o.isSecret; 81 | const problem: string|undefined = 82 | !isKnown ? "an unknown value" 83 | : isSecret ? "a secret value" 84 | : undefined; 85 | // Ingoring o.resources silently. They are typically non-empty, r.f() calls include r as a dependency. 86 | if (problem) { 87 | throw new Error(`Plain resource method "${tok}" incorrectly returned ${problem}. ` + 88 | "This is an error in the provider, please report this to the provider developer."); 89 | } 90 | // Extract a single property if requested. 91 | if (opts && opts.property) { 92 | return value[opts.property]; 93 | } 94 | return value; 95 | } 96 | -------------------------------------------------------------------------------- /sdk/python/Pulumi.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1Password/pulumi-onepassword/559bf4f66874e6ac6875fdb08cfe71ab0b98b273/sdk/python/Pulumi.yaml -------------------------------------------------------------------------------- /sdk/python/README.md: -------------------------------------------------------------------------------- 1 | # 1Password Pulumi provider 2 | 3 | Use the 1Password Pulumi provider to access and manage items in your 1Password vaults. 4 | 5 | ## Installing 6 | 7 | This package is available for several languages/platforms: 8 | 9 | ### Node.js (JavaScript/TypeScript) 10 | 11 | To use from JavaScript or TypeScript in Node.js, install using either `npm`: 12 | 13 | ```bash 14 | npm install @1password/pulumi-onepassword 15 | ``` 16 | 17 | or `yarn`: 18 | 19 | ```bash 20 | yarn add @1password/pulumi-onepassword 21 | ``` 22 | 23 | ### Python 24 | 25 | To use from Python, install using `pip`: 26 | 27 | ```bash 28 | pip install pulumi_onepassword 29 | ``` 30 | 31 | ### Go 32 | 33 | To use from Go, use `go get` to grab the latest version of the library: 34 | 35 | 36 | 37 | 38 | ```bash 39 | go get github.com/1Password/pulumi-onepassword/sdk/go/... 40 | ``` 41 | 42 | 55 | 56 | ## Configuration 57 | 58 | The following configuration points are available for the `1Password` provider: 59 | 60 | - `pulumi-onepassword:url` (environment: `OP_CONNECT_HOST`) - the URL where your 1Password Connect API can be found 61 | - `pulumi-onepassword:token` (environment: `OP_CONNECT_TOKEN`) - the token for your Connect API. 62 | - `pulumi-onepassword:service_account_token` (environment: `OP_SERVICE_ACCOUNT_TOKEN`) - The 1Password service account token to use with 1Password CLI. 63 | - `pulumi-onepassword:account` (environment: `OP_ACCOUNT`) - A valid account's sign-in address or ID to use with 1Password CLI and biometric unlock. 64 | - `pulumi-onepassword:op_cli_path` (environment: `OP_CLI_PATH`) - The path to the 1Password CLI binary. 65 | 66 | ## Reference 67 | 68 | 69 | 70 | For detailed reference documentation, please visit [the Pulumi registry](https://www.pulumi.com/registry/packages/onepassword/). 71 | -------------------------------------------------------------------------------- /sdk/python/pulumi_onepassword/README.md: -------------------------------------------------------------------------------- 1 | > This provider is a derived work of the [Terraform Provider](https://github.com/1Password/terraform-provider-onepassword) 2 | > distributed under [MPL 2.0](https://www.mozilla.org/en-US/MPL/2.0/). If you encounter a bug or missing feature, 3 | > first check the [`pulumi-onepassword` repo](https://github.com/1Password/pulumi-onepassword/issues); however, if that doesn't turn up anything, 4 | > please consult the source [`terraform-provider-onepassword` repo](https://github.com/1Password/terraform-provider-onepassword/issues). -------------------------------------------------------------------------------- /sdk/python/pulumi_onepassword/__init__.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** 3 | # *** Do not edit by hand unless you're certain you know what you are doing! *** 4 | 5 | from . import _utilities 6 | import typing 7 | # Export this package's modules as members: 8 | from .get_item import * 9 | from .get_vault import * 10 | from .item import * 11 | from .provider import * 12 | from ._inputs import * 13 | from . import outputs 14 | 15 | # Make subpackages available: 16 | if typing.TYPE_CHECKING: 17 | import pulumi_onepassword.config as __config 18 | config = __config 19 | else: 20 | config = _utilities.lazy_import('pulumi_onepassword.config') 21 | 22 | _utilities.register( 23 | resource_modules=""" 24 | [ 25 | { 26 | "pkg": "onepassword", 27 | "mod": "index/item", 28 | "fqn": "pulumi_onepassword", 29 | "classes": { 30 | "onepassword:index/item:Item": "Item" 31 | } 32 | } 33 | ] 34 | """, 35 | resource_packages=""" 36 | [ 37 | { 38 | "pkg": "onepassword", 39 | "token": "pulumi:providers:onepassword", 40 | "fqn": "pulumi_onepassword", 41 | "class": "Provider" 42 | } 43 | ] 44 | """ 45 | ) 46 | -------------------------------------------------------------------------------- /sdk/python/pulumi_onepassword/config/__init__.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** 3 | # *** Do not edit by hand unless you're certain you know what you are doing! *** 4 | 5 | import sys 6 | from .vars import _ExportableConfig 7 | 8 | sys.modules[__name__].__class__ = _ExportableConfig 9 | -------------------------------------------------------------------------------- /sdk/python/pulumi_onepassword/config/__init__.pyi: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** 3 | # *** Do not edit by hand unless you're certain you know what you are doing! *** 4 | 5 | import copy 6 | import warnings 7 | import pulumi 8 | import pulumi.runtime 9 | from typing import Any, Mapping, Optional, Sequence, Union, overload 10 | from .. import _utilities 11 | 12 | account: Optional[str] 13 | """ 14 | A valid account's sign-in address or ID to use biometrics unlock. Can also be sourced from `OP_ACCOUNT` environment 15 | variable. Provider will use the 1Password CLI if set. 16 | """ 17 | 18 | opCliPath: Optional[str] 19 | """ 20 | The path to the 1Password CLI binary. Can also be sourced from `OP_CLI_PATH` environment variable. Defaults to `op`. 21 | """ 22 | 23 | serviceAccountToken: Optional[str] 24 | """ 25 | A valid 1Password service account token. Can also be sourced from `OP_SERVICE_ACCOUNT_TOKEN` environment variable. 26 | Provider will use the 1Password CLI if set. 27 | """ 28 | 29 | token: Optional[str] 30 | """ 31 | A valid token for your 1Password Connect server. Can also be sourced from `OP_CONNECT_TOKEN` environment variable. 32 | Provider will use 1Password Connect server if set. 33 | """ 34 | 35 | url: Optional[str] 36 | """ 37 | The HTTP(S) URL where your 1Password Connect server can be found. Can also be sourced `OP_CONNECT_HOST` environment 38 | variable. Provider will use 1Password Connect server if set. 39 | """ 40 | 41 | -------------------------------------------------------------------------------- /sdk/python/pulumi_onepassword/config/vars.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** 3 | # *** Do not edit by hand unless you're certain you know what you are doing! *** 4 | 5 | import copy 6 | import warnings 7 | import pulumi 8 | import pulumi.runtime 9 | from typing import Any, Mapping, Optional, Sequence, Union, overload 10 | from .. import _utilities 11 | 12 | import types 13 | 14 | __config__ = pulumi.Config('onepassword') 15 | 16 | 17 | class _ExportableConfig(types.ModuleType): 18 | @property 19 | def account(self) -> Optional[str]: 20 | """ 21 | A valid account's sign-in address or ID to use biometrics unlock. Can also be sourced from `OP_ACCOUNT` environment 22 | variable. Provider will use the 1Password CLI if set. 23 | """ 24 | return __config__.get('account') or _utilities.get_env('OP_ACCOUNT') 25 | 26 | @property 27 | def op_cli_path(self) -> Optional[str]: 28 | """ 29 | The path to the 1Password CLI binary. Can also be sourced from `OP_CLI_PATH` environment variable. Defaults to `op`. 30 | """ 31 | return __config__.get('opCliPath') or _utilities.get_env('OP_CLI_PATH') 32 | 33 | @property 34 | def service_account_token(self) -> Optional[str]: 35 | """ 36 | A valid 1Password service account token. Can also be sourced from `OP_SERVICE_ACCOUNT_TOKEN` environment variable. 37 | Provider will use the 1Password CLI if set. 38 | """ 39 | return __config__.get('serviceAccountToken') or _utilities.get_env('OP_SERVICE_ACCOUNT_TOKEN') 40 | 41 | @property 42 | def token(self) -> Optional[str]: 43 | """ 44 | A valid token for your 1Password Connect server. Can also be sourced from `OP_CONNECT_TOKEN` environment variable. 45 | Provider will use 1Password Connect server if set. 46 | """ 47 | return __config__.get('token') or _utilities.get_env('OP_CONNECT_TOKEN') 48 | 49 | @property 50 | def url(self) -> Optional[str]: 51 | """ 52 | The HTTP(S) URL where your 1Password Connect server can be found. Can also be sourced `OP_CONNECT_HOST` environment 53 | variable. Provider will use 1Password Connect server if set. 54 | """ 55 | return __config__.get('url') or _utilities.get_env('OP_CONNECT_HOST') 56 | 57 | -------------------------------------------------------------------------------- /sdk/python/pulumi_onepassword/get_vault.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** 3 | # *** Do not edit by hand unless you're certain you know what you are doing! *** 4 | 5 | import copy 6 | import warnings 7 | import pulumi 8 | import pulumi.runtime 9 | from typing import Any, Mapping, Optional, Sequence, Union, overload 10 | from . import _utilities 11 | 12 | __all__ = [ 13 | 'GetVaultResult', 14 | 'AwaitableGetVaultResult', 15 | 'get_vault', 16 | 'get_vault_output', 17 | ] 18 | 19 | @pulumi.output_type 20 | class GetVaultResult: 21 | """ 22 | A collection of values returned by getVault. 23 | """ 24 | def __init__(__self__, description=None, id=None, name=None, uuid=None): 25 | if description and not isinstance(description, str): 26 | raise TypeError("Expected argument 'description' to be a str") 27 | pulumi.set(__self__, "description", description) 28 | if id and not isinstance(id, str): 29 | raise TypeError("Expected argument 'id' to be a str") 30 | pulumi.set(__self__, "id", id) 31 | if name and not isinstance(name, str): 32 | raise TypeError("Expected argument 'name' to be a str") 33 | pulumi.set(__self__, "name", name) 34 | if uuid and not isinstance(uuid, str): 35 | raise TypeError("Expected argument 'uuid' to be a str") 36 | pulumi.set(__self__, "uuid", uuid) 37 | 38 | @property 39 | @pulumi.getter 40 | def description(self) -> str: 41 | """ 42 | The description of the vault. 43 | """ 44 | return pulumi.get(self, "description") 45 | 46 | @property 47 | @pulumi.getter 48 | def id(self) -> str: 49 | return pulumi.get(self, "id") 50 | 51 | @property 52 | @pulumi.getter 53 | def name(self) -> str: 54 | """ 55 | The name of the vault to retrieve. This field will be populated with the name of the vault if the vault it looked up by its UUID. 56 | """ 57 | return pulumi.get(self, "name") 58 | 59 | @property 60 | @pulumi.getter 61 | def uuid(self) -> str: 62 | """ 63 | The UUID of the vault to retrieve. This field will be populated with the UUID of the vault if the vault it looked up by its name. 64 | """ 65 | return pulumi.get(self, "uuid") 66 | 67 | 68 | class AwaitableGetVaultResult(GetVaultResult): 69 | # pylint: disable=using-constant-test 70 | def __await__(self): 71 | if False: 72 | yield self 73 | return GetVaultResult( 74 | description=self.description, 75 | id=self.id, 76 | name=self.name, 77 | uuid=self.uuid) 78 | 79 | 80 | def get_vault(name: Optional[str] = None, 81 | uuid: Optional[str] = None, 82 | opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetVaultResult: 83 | """ 84 | Use this data source to get details of a vault by either its name or uuid. 85 | 86 | ## Example Usage 87 | 88 | ```python 89 | import pulumi 90 | import pulumi_onepassword as onepassword 91 | 92 | example = onepassword.get_vault(name="your-vault-name") 93 | ``` 94 | 95 | 96 | :param str name: The name of the vault to retrieve. This field will be populated with the name of the vault if the vault it looked up by its UUID. 97 | :param str uuid: The UUID of the vault to retrieve. This field will be populated with the UUID of the vault if the vault it looked up by its name. 98 | """ 99 | __args__ = dict() 100 | __args__['name'] = name 101 | __args__['uuid'] = uuid 102 | opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts) 103 | __ret__ = pulumi.runtime.invoke('onepassword:index/getVault:getVault', __args__, opts=opts, typ=GetVaultResult).value 104 | 105 | return AwaitableGetVaultResult( 106 | description=pulumi.get(__ret__, 'description'), 107 | id=pulumi.get(__ret__, 'id'), 108 | name=pulumi.get(__ret__, 'name'), 109 | uuid=pulumi.get(__ret__, 'uuid')) 110 | 111 | 112 | @_utilities.lift_output_func(get_vault) 113 | def get_vault_output(name: Optional[pulumi.Input[Optional[str]]] = None, 114 | uuid: Optional[pulumi.Input[Optional[str]]] = None, 115 | opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetVaultResult]: 116 | """ 117 | Use this data source to get details of a vault by either its name or uuid. 118 | 119 | ## Example Usage 120 | 121 | ```python 122 | import pulumi 123 | import pulumi_onepassword as onepassword 124 | 125 | example = onepassword.get_vault(name="your-vault-name") 126 | ``` 127 | 128 | 129 | :param str name: The name of the vault to retrieve. This field will be populated with the name of the vault if the vault it looked up by its UUID. 130 | :param str uuid: The UUID of the vault to retrieve. This field will be populated with the UUID of the vault if the vault it looked up by its name. 131 | """ 132 | ... 133 | -------------------------------------------------------------------------------- /sdk/python/pulumi_onepassword/pulumi-plugin.json: -------------------------------------------------------------------------------- 1 | { 2 | "resource": true, 3 | "name": "onepassword", 4 | "server": "github://api.github.com/1Password/pulumi-onepassword" 5 | } 6 | -------------------------------------------------------------------------------- /sdk/python/pulumi_onepassword/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1Password/pulumi-onepassword/559bf4f66874e6ac6875fdb08cfe71ab0b98b273/sdk/python/pulumi_onepassword/py.typed -------------------------------------------------------------------------------- /sdk/python/setup.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** 3 | # *** Do not edit by hand unless you're certain you know what you are doing! *** 4 | 5 | import errno 6 | from setuptools import setup, find_packages 7 | from setuptools.command.install import install 8 | from subprocess import check_call 9 | 10 | 11 | VERSION = "0.0.0" 12 | def readme(): 13 | try: 14 | with open('README.md', encoding='utf-8') as f: 15 | return f.read() 16 | except FileNotFoundError: 17 | return "onepassword Pulumi Package - Development Version" 18 | 19 | 20 | setup(name='pulumi_onepassword', 21 | python_requires='>=3.8', 22 | version=VERSION, 23 | description="Use the 1Password Pulumi provider to access and manage items in your 1Password vaults.", 24 | long_description=readme(), 25 | long_description_content_type='text/markdown', 26 | keywords='pulumi onepassword 1Password category/cloud', 27 | url='https://www.developer.1password.com', 28 | project_urls={ 29 | 'Repository': 'https://github.com/1Password/pulumi-onepassword' 30 | }, 31 | license='Apache-2.0', 32 | packages=find_packages(), 33 | package_data={ 34 | 'pulumi_onepassword': [ 35 | 'py.typed', 36 | 'pulumi-plugin.json', 37 | ] 38 | }, 39 | install_requires=[ 40 | 'parver>=0.2.1', 41 | 'pulumi>=3.0.0,<4.0.0', 42 | 'semver>=2.8.1' 43 | ], 44 | zip_safe=False) 45 | --------------------------------------------------------------------------------