diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..7bb6804 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,2 @@ +# Maintained by the MongoDB APIx-Integrations team +* @mongodb-labs/APIx-Integrations diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000..a0bfe99 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,61 @@ +name: Bug report +description: Something unexpected happen? Report an error, crash, or an incorrect behavior here. +title: "[Bug]: " +body: + - type: markdown + attributes: + value: | + Thank you for opening an issue. **These GitHub issues** are only for community reporting and assistance; as such, we don't have a guaranteed SLA. + + **If your issue relates to Terraform itself**, please open it in the [Terraform repository](https://github.com/hashicorp/terraform/issues). + + **If you have an active MongoDB Atlas Support contract**, the best way for us to assist you with the Terraform MongoDB Atlas Provider is through a support ticket. + + **Please note:** In order for us to provide the best experience in supporting our customers, we kindly ask to make sure that all the following sections are correctly filled with all the required information. + Our support will prioritise issues that contain all the required information that follows the [one-click reproducible issues principle](../../README.md#one-click-reproducible-issues-principle). + + - type: checkboxes + attributes: + label: Is there an existing issue for this? + description: Please search to see if an issue already exists for the bug you encountered. If the issue has been reported add a reaction, i.e. +1, to the issue. + options: + - label: I have searched the existing issues + required: true + + - type: textarea + id: current_behaviour + attributes: + label: Current Behavior + description: A concise description of what you're experiencing. + validations: + required: true + + - type: textarea + attributes: + label: Steps To Reproduce + description: Steps to reproduce the behaviour. + placeholder: | + 1. In this environment... + 2. With this config... + 3. Run '...' + 4. See error... + validations: + required: true + + - type: textarea + id: logs + attributes: + label: Logs + description: Additional logs that can help us investigate the issue. This will be automatically formatted into code, so no need for backticks. + render: txt + validations: + required: false + + - type: checkboxes + id: terms + attributes: + label: Code of Conduct + description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/mongodb-labs/atlas-cli-plugin-terraform/blob/master/CODE_OF_CONDUCT.md) + options: + - label: I agree to follow this project's Code of Conduct + required: true diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..72ee9a3 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,11 @@ +blank_issues_enabled: true +contact_links: + - name: Terraform MongoDB Atlas Provider Feature Request + url: https://feedback.mongodb.com/forums/924145-atlas?category_id=370723 + about: Request a feature or up-vote an existing suggestion! + - name: MongoDB Atlas Support + url: https://support.mongodb.com/ + about: Support is provided under MongoDB Atlas support plans. Please submit support questions within the Atlas UI. + - name: MongoDB Atlas + url: https://www.mongodb.com/cloud/atlas + about: Learn more about MongoDB Atlas diff --git a/.github/actionlint-matcher.json b/.github/actionlint-matcher.json new file mode 100644 index 0000000..dcb9d32 --- /dev/null +++ b/.github/actionlint-matcher.json @@ -0,0 +1,18 @@ +{ + "problemMatcher": [ + { + "owner": "actionlint", + "severity": "warning", + "pattern": [ + { + "regexp": "^(?:\\x1b\\[\\d+m)?(.+?)(?:\\x1b\\[\\d+m)*:(?:\\x1b\\[\\d+m)*(\\d+)(?:\\x1b\\[\\d+m)*:(?:\\x1b\\[\\d+m)*(\\d+)(?:\\x1b\\[\\d+m)*: (?:\\x1b\\[\\d+m)*(.+?)(?:\\x1b\\[\\d+m)* \\[(.+?)\\]$", + "file": 1, + "line": 2, + "column": 3, + "message": 4, + "code": 5 + } + ] + } + ] +} \ No newline at end of file diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..a1daf93 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,20 @@ +version: 2 +updates: + - package-ecosystem: gomod + directory: "/" + schedule: + interval: weekly + day: tuesday + commit-message: + prefix: "chore" + reviewers: + - "mongodb-labs/apix-integrations" + - package-ecosystem: github-actions + directory: "/" + schedule: + interval: weekly + day: tuesday + commit-message: + prefix: "chore" + reviewers: + - "mongodb-labs/apix-integrations" diff --git a/.github/pr-labeler.yml b/.github/pr-labeler.yml new file mode 100644 index 0000000..37d9654 --- /dev/null +++ b/.github/pr-labeler.yml @@ -0,0 +1,10 @@ +version: 1 +labels: + - label: "breaking-change" + title: "!" + - label: "enhancement" + title: "feat:*" + - label: "enhancement" + title: "feature:*" + - label: "bug" + title: "fix:*" diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..af9c8ae --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,26 @@ +## Description + +Please include a summary of the fix/feature/change, including any relevant motivation and context. + +Link to any related issue(s): + +## Type of change: + +- [ ] Bug fix (non-breaking change which fixes an issue). Please, add the "bug" label to the PR. +- [ ] New feature (non-breaking change which adds functionality). Please, add the "enhancement" label to the PR. A migration guide must be created or updated if the new feature will go in a major version. +- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected). Please, add the "breaking change" label to the PR. A migration guide must be created or updated. +- [ ] This change requires a documentation update +- [ ] Documentation fix/enhancement + +## Required Checklist: + +- [ ] I have signed the [MongoDB CLA](https://www.mongodb.com/legal/contributor-agreement) +- [ ] I have read the [contributing guides](https://github.com/mongodb-labs/atlas-cli-plugin-terraform/blob/master/CONTRIBUTING.md) +- [ ] I have checked that this change does not generate any credentials and that **they are NOT accidentally logged anywhere**. +- [ ] I have added tests that prove my fix is effective or that my feature works per HashiCorp requirements +- [ ] I have added any necessary documentation (if appropriate) +- [ ] I have run make fmt and formatted my code +- [ ] If changes include deprecations or removals I have added appropriate changelog entries. +- [ ] If changes include removal or addition of 3rd party GitHub actions, I updated our internal document. Reach out to the APIx Integration slack channel to get access to the internal document. + +## Further comments diff --git a/.github/workflows/code-health.yml b/.github/workflows/code-health.yml new file mode 100644 index 0000000..f678e45 --- /dev/null +++ b/.github/workflows/code-health.yml @@ -0,0 +1,43 @@ +name: 'Code Health' + +on: + push: + branches: + - master + pull_request: + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + permissions: {} + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 + - uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a + with: + go-version-file: 'go.mod' + - name: Build + run: make build + lint: + runs-on: ubuntu-latest + permissions: {} + steps: + - name: Checkout + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 + - name: Install Go + uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a + with: + go-version-file: 'go.mod' + cache: false # see https://github.com/golangci/golangci-lint-action/issues/807 + - name: golangci-lint + uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 + with: + version: v1.63.4 # Also update GOLANGCI_VERSION variable in GNUmakefile when updating this version + - name: actionlint + run: | + make tools + echo "::add-matcher::.github/actionlint-matcher.json" + actionlint -color + shell: bash + - name: shellcheck + uses: bewuethr/shellcheck-action@d01912909579c4b1a335828b8fca197fbb8e0aa4 diff --git a/.github/workflows/issues.yml b/.github/workflows/issues.yml new file mode 100644 index 0000000..c02b992 --- /dev/null +++ b/.github/workflows/issues.yml @@ -0,0 +1,174 @@ +--- + name: Create JIRA ticket for new issues + + # Creates and updates jira tickets that sync with GitHub Issues events. + on: + issues: + types: [opened, reopened, closed] + jobs: + jira_task: + name: Create Jira issue + if: github.event.action == 'opened' + runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{ secrets.APIX_BOT_PAT }} + steps: + - name: Create JIRA ticket + id: create + shell: bash + env: + ISSUE_NUMBER: ${{ github.event.issue.number }} + ISSUE_URL: ${{ github.event.issue.html_url }} + JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }} + JIRA_ASSIGNEE: ${{ secrets.ASSIGNEE_JIRA_TICKET }} + run: | + json_response=$(curl --request POST \ + --url 'https://jira.mongodb.org/rest/api/2/issue' \ + --header 'Authorization: Bearer '"${JIRA_API_TOKEN}" \ + --header 'Accept: application/json' \ + --header 'Content-Type: application/json' \ + --data '{ + "fields": { + "project": { + "id": "10984" + }, + "summary": "HELP: GitHub Issue n. '"${ISSUE_NUMBER}"'", + "issuetype": { + "id": "12" + }, + "customfield_12751": [{ + "id": "25550" + }], + "description": "This ticket tracks the following GitHub issue: '"${ISSUE_URL}"'.", + "components": [ + { + "id": "34035" + } + ] + } + }') + + echo "Response: ${json_response}" + + JIRA_TICKET_ID=$(echo "${json_response}" | jq -r '.key') + + echo "The following JIRA ticket has been created: ${JIRA_TICKET_ID}" + echo "jira-ticket-id=${JIRA_TICKET_ID}" >> "${GITHUB_OUTPUT}" + - name: Add comment + uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 + with: + issue-number: ${{ github.event.issue.number }} + body: | + Thanks for opening this issue! Please make sure you've followed [our guidelines](https://github.com/mongodb/terraform-provider-mongodbatlas/issues/new?assignees=&labels=&projects=&template=Bug_Report.md) when opening the issue. In short, to help us reproduce the issue we need: + - Terraform configuration file used to reproduce the issue + - Terraform log files from the run where the issue occurred + - Terraform Atlas provider version used to reproduce the issue + - Terraform version used to reproduce the issue + - Confirmation if Terraform OSS, Terraform Cloud, or Terraform Enterprise deployment + + The ticket [${{ steps.create.outputs.jira-ticket-id }}](https://jira.mongodb.org/browse/${{ steps.create.outputs.jira-ticket-id }}) was created for internal tracking. + reopen_jira_ticket: + name: Reopen JIRA ticket + if: github.event.action == 'reopened' + runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{ secrets.APIX_BOT_PAT }} + steps: + - name: Reopened JIRA ticket if exists + run: | + ISSUE_NUMBER=${{ github.event.issue.number }} + JIRA_API_TOKEN=${{ secrets.JIRA_API_TOKEN }} + + JIRA_QUERY="project = CLOUDP AND issuetype = Story AND resolution = Declined AND text ~ \"HELP: GitHub Issue n. $ISSUE_NUMBER\"" + + # URL encode the query + JIRA_URL=$(echo "$JIRA_QUERY" | jq -s -R -r @uri) + + json_response=$(curl -s --request GET \ + --url "https://jira.mongodb.org/rest/api/2/search?fields=id&jql=${JIRA_URL}" \ + --header 'Authorization: Bearer '"${JIRA_API_TOKEN}" \ + --header 'Accept: application/json') + + JIRA_TICKET_ID=$(echo "${json_response}" | jq -r '.issues[0].id') + if [ -z "$JIRA_TICKET_ID" ]; then + echo "JIRA_TICKET_ID is not defined. Exiting the script." + exit 1 + fi + + JIRA_REOPENED_URL="https://jira.mongodb.org/rest/api/2/issue/${JIRA_TICKET_ID}/transitions" + + json_response=$(curl -s --request POST \ + --url "${JIRA_REOPENED_URL}" \ + --header 'Authorization: Bearer '"${JIRA_API_TOKEN}" \ + --header 'Accept: application/json' \ + --header 'Content-Type: application/json' \ + --data '{ + "transition": { + "id": 3 + }, + "update": { + "comment": [ + { + "add": { + "body": "The related GitHub issue was reopened. Updated via automated process." + } + } + ] + } + }') + echo "Response: ${json_response}" + close_jira_ticket: + name: Close JIRA ticket + if: github.event.action == 'closed' + runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{ secrets.APIX_BOT_PAT }} + steps: + - name: Close JIRA ticket if exists + run: | + ISSUE_NUMBER=${{ github.event.issue.number }} + JIRA_API_TOKEN=${{ secrets.JIRA_API_TOKEN }} + + JIRA_QUERY="project = CLOUDP AND issuetype = Story AND resolution = Unresolved AND text ~ \"HELP: GitHub Issue n. $ISSUE_NUMBER\"" + + # URL encode the query + JIRA_URL=$(echo "$JIRA_QUERY" | jq -s -R -r @uri) + + json_response=$(curl -s --request GET \ + --url "https://jira.mongodb.org/rest/api/2/search?fields=id&jql=${JIRA_URL}" \ + --header 'Authorization: Bearer '"${JIRA_API_TOKEN}" \ + --header 'Accept: application/json') + + JIRA_TICKET_ID=$(echo "${json_response}" | jq -r '.issues[0].id') + if [ -z "$JIRA_TICKET_ID" ]; then + echo "JIRA_TICKET_ID is not defined. Exiting the script." + exit 1 + fi + + JIRA_CLOSE_URL="https://jira.mongodb.org/rest/api/2/issue/${JIRA_TICKET_ID}/transitions" + + json_response=$(curl -s --request POST \ + --url "${JIRA_CLOSE_URL}" \ + --header 'Authorization: Bearer '"${JIRA_API_TOKEN}" \ + --header 'Accept: application/json' \ + --header 'Content-Type: application/json' \ + --data '{ + "transition": { + "id": 1371 + }, + "update": { + "comment": [ + { + "add": { + "body": "The related GitHub issue was closed. Resolved via automated process." + } + } + ] + }, + "fields": { + "resolution": { + "name": "Declined" + } + } + }') + echo "Response: ${json_response}" diff --git a/.github/workflows/pull-request-lint.yml b/.github/workflows/pull-request-lint.yml new file mode 100644 index 0000000..1d7291f --- /dev/null +++ b/.github/workflows/pull-request-lint.yml @@ -0,0 +1,82 @@ +name: pull-request-lint + +# Run validations over pull request titles while also adding appropriate labels. +on: + pull_request: + types: + - labeled + - opened + - synchronize + - reopened + - ready_for_review + - edited +jobs: + validate: + name: Validate PR title + runs-on: ubuntu-latest + permissions: + pull-requests: write # Needed by sticky-pull-request-comment + steps: + - uses: amannn/action-semantic-pull-request@0723387faaf9b38adef4775cd42cfd5155ed6017 + id: lint_pr_title + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + types: |- + feat + fix + chore + doc + test + security + remove + deprecate + refactor + perf + ci + revert + style + requireScope: false + # Ensures the subject start with an uppercase character. + subjectPattern: ^([A-Z]).+$ + subjectPatternError: | + The subject "{subject}" found in the pull request title "{title}" + didn't match the configured pattern. Please ensure that the subject + starts with an uppercase character. + - uses: marocchino/sticky-pull-request-comment@331f8f5b4215f0445d3c07b4967662a32a2d3e31 + # When the previous steps fails, the workflow would stop. By adding this + # condition you can continue the execution with the populated error message. + if: always() && (steps.lint_pr_title.outputs.error_message != null) + with: + header: pr-title-lint-error + message: | + Hey there and thank you for opening this pull request! 👋🏼 + + We require pull request titles to follow the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/) and it looks like your proposed title needs to be adjusted. + + Additionally, the subject of the title must start with an uppercase character (e.g. feat: New `search` component). + + Details: [contributing development guide](https://github.com/mongodb/terraform-provider-mongodbatlas/blob/master/contributing/development-setup.md#pr-title-format) + + ``` + ${{ steps.lint_pr_title.outputs.error_message }} + ``` + # Delete a previous comment when the issue has been resolved + - if: ${{ steps.lint_pr_title.outputs.error_message == null }} + uses: marocchino/sticky-pull-request-comment@331f8f5b4215f0445d3c07b4967662a32a2d3e31 + with: + header: pr-title-lint-error + delete: true + labeler: + name: Add Label + needs: [ validate ] + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write # Needed by labeler + steps: + - uses: srvaroa/labeler@fe4b1c73bb8abf2f14a44a6912a8b4fee835d631 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + config_path: .github/pr-labeler.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..dd9b682 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,11 @@ +name: 'New Release' + +on: + workflow_dispatch: + +jobs: + release: + runs-on: ubuntu-latest + permissions: {} + steps: + - run: echo "WIP - Placeholder for release GHA" diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 0000000..d6e4cb9 --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,26 @@ +--- +name: 'Stale issues and PRs handler' + +# Handles stale github issues and pull requests. +on: + workflow_dispatch: + schedule: + - cron: '0 0 * * *' + +jobs: + stale: + runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{ secrets.APIX_BOT_PAT }} + steps: + - uses: actions/stale@28ca1036281a5e5922ead5184a1bbf96e5fc984e + id: stale + with: + stale-issue-message: 'This issue has gone 7 days without any activity and meets the project’s definition of "stale". This will be auto-closed if there is no new activity over the next 7 days. If the issue is still relevant and active, you can simply comment with a "bump" to keep it open, or add the label "not_stale". Thanks for keeping our repository healthy!' + stale-pr-message: 'This PR has gone 7 days without any activity and meets the project’s definition of "stale". This will be auto-closed if there is no new activity over the next 7 days. If the issue is still relevant and active, you can simply comment with a "bump" to keep it open, or add the label "not_stale". Thanks for keeping our repository healthy!' + stale-issue-label: 'stale' + stale-pr-label: 'stale' + days-before-stale: 5 + days-before-close: 2 + exempt-pr-labels: 'not_stale' + exempt-issue-labels: 'not_stale' diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ba077a4 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +bin diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..df25fe0 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,107 @@ +linters-settings: + gocritic: + enabled-tags: + - diagnostic + - experimental + - opinionated + - performance + - style + govet: + enable-all: true + + revive: + # see https://github.com/mgechev/revive#available-rules for details. + ignore-generated-header: true + severity: warning + rules: + - name: blank-imports + - name: context-as-argument + - name: context-keys-type + - name: dot-imports + - name: error-return + - name: error-strings + - name: error-naming + - name: errorf + - name: exported + - name: indent-error-flow + - name: if-return + - name: increment-decrement + - name: var-naming + - name: var-declaration + - name: package-comments + - name: range + - name: receiver-naming + - name: time-naming + - name: unexported-return + - name: indent-error-flow + - name: errorf + - name: empty-block + - name: superfluous-else + - name: struct-tag + # Too many unusued parameters, skipping this check for now + #- name: unused-parameter + - name: unreachable-code + - name: redefines-builtin-id + misspell: + locale: US + ignore-words: + - cancelled + lll: + # Default is 120. '\t' is counted as 1 character. + # set our project to 500, as we are adding open api field description in the schema. + # also, for anyone using vscode, use the following configs: + # "rewrap.wrappingColumn": 500 ... requires the rewrap plugin + # "editor.rulers": [500] + line-length: 500 + nestif: + # minimal complexity of if statements to report, 5 by default + min-complexity: 7 + mnd: + checks: + - case + - operation + - return + funlen: + lines: 360 + statements: 120 +linters: + disable-all: true + enable: + - dogsled + - errcheck + - funlen + - gocritic + - gofmt + - goimports + - revive + - mnd + - goprintffuncname + - gosec + - gosimple + - govet + - ineffassign + - lll + - misspell + - nakedret + - nolintlint + - rowserrcheck + - copyloopvar + - staticcheck + - stylecheck + - typecheck + - unconvert + - unused + - whitespace + - thelper + - testifylint + - exhaustive + - makezero + - noctx + - tenv + - testpackage +run: + timeout: 10m + tests: true + build-tags: + - integration + modules-download-mode: readonly diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..a7ac03d --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1 @@ +## (Unreleased) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..5e52b08 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,5 @@ +# Code of Conduct + +This project has adopted the [MongoDB Code of Conduct](https://www.mongodb.com/community-code-of-conduct). +If you see any violations of the above or have any other concerns or questions please contact us +using the following email alias: community-conduct@mongodb.com. \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..e4dc21b --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,3 @@ +# Contributing to Atlas CLI plugin for MongoDB Atlas Provider + +WIP diff --git a/GNUmakefile b/GNUmakefile new file mode 100644 index 0000000..7bec63d --- /dev/null +++ b/GNUmakefile @@ -0,0 +1,18 @@ +CLI_SOURCE_FILES?=./cmd/plugin +CLI_BINARY_NAME?=binary +CLI_DESTINATION=./bin/$(CLI_BINARY_NAME) + +GOLANGCI_VERSION=v1.63.4 # Also update golangci-lint GH action in code-health.yml when updating this version + +.PHONY: build +build: + @echo "==> Building plugin binary: $(CLI_BINARY_NAME)" + go build -o $(CLI_DESTINATION) $(CLI_SOURCE_FILES) + +.PHONY: tools +tools: + @echo "==> Installing dev tools..." + go telemetry off # disable sending telemetry data, more info: https://go.dev/doc/telemetry + go install github.com/rhysd/actionlint/cmd/actionlint@latest + go install golang.org/x/tools/go/analysis/passes/fieldalignment/cmd/fieldalignment@latest + curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell go env GOPATH)/bin $(GOLANGCI_VERSION) diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/LICENSING-NOTES.txt b/LICENSING-NOTES.txt new file mode 100644 index 0000000..e51c270 --- /dev/null +++ b/LICENSING-NOTES.txt @@ -0,0 +1 @@ +Any other software pulled down during your use of this Atlas CLI plugin will be subject to its own license and copyright notice, which will be included in that package. diff --git a/README.md b/README.md index 606f903..9616989 100644 --- a/README.md +++ b/README.md @@ -1 +1,7 @@ # Atlas CLI plugin for MongoDB Atlas Provider + +[![Code Health](https://github.com/mongodb-labs/atlas-cli-plugin-terraform/actions/workflows/code-health.yml/badge.svg)](https://github.com/mongodb-labs/atlas-cli-plugin-terraform/actions/workflows/code-health.yml) + +This repository contains the Atlas CLI plugin for MongoDB Atlas Provider. + +WIP diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..3fefd62 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,7 @@ +# Security Policy + +## Reporting a Vulnerability + +Any security concerns or vulnerabilities discovered in one of MongoDB’s products or hosted services can be responsibly disclosed by utilizing one of the methods described in our [create a vulnerability report](https://docs.mongodb.com/manual/tutorial/create-a-vulnerability-report/) docs page. + +While we greatly appreciate community reports regarding security issues, at this time MongoDB does not provide compensation for vulnerability reports. diff --git a/cmd/plugin/main.go b/cmd/plugin/main.go new file mode 100644 index 0000000..6d54162 --- /dev/null +++ b/cmd/plugin/main.go @@ -0,0 +1,7 @@ +package main + +import "fmt" + +func main() { + fmt.Println("WIP - Placeholder for CLI plugin entrypoint") +} diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..1698ba9 --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module github.com/mongodb-labs/atlas-cli-plugin-terraform + +go 1.23.4