{"id":28578297,"url":"https://github.com/digitalocean/terraform-provider-sendgrid","last_synced_at":"2025-06-11T01:09:31.209Z","repository":{"id":56202356,"uuid":"246116480","full_name":"digitalocean/terraform-provider-sendgrid","owner":"digitalocean","description":"Sendgrid Terraform Provider","archived":false,"fork":false,"pushed_at":"2020-11-20T19:02:49.000Z","size":35,"stargazers_count":20,"open_issues_count":1,"forks_count":8,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-15T00:19:51.384Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/digitalocean.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-09T18:49:55.000Z","updated_at":"2024-07-22T20:47:56.000Z","dependencies_parsed_at":"2022-08-15T14:31:53.726Z","dependency_job_id":null,"html_url":"https://github.com/digitalocean/terraform-provider-sendgrid","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitalocean%2Fterraform-provider-sendgrid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitalocean%2Fterraform-provider-sendgrid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitalocean%2Fterraform-provider-sendgrid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitalocean%2Fterraform-provider-sendgrid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/digitalocean","download_url":"https://codeload.github.com/digitalocean/terraform-provider-sendgrid/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitalocean%2Fterraform-provider-sendgrid/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259178542,"owners_count":22817388,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-11T01:09:30.175Z","updated_at":"2025-06-11T01:09:31.190Z","avatar_url":"https://github.com/digitalocean.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"Terraform-Provider-Sendgrid\n===========================\n\nA Terraform provider for management of Sendgrid resources. Currently, the following resources are supported:\n\n* [sendgrid_api_key](#resource-sendgrid_api_key)\n* [sendgrid_subuser](#resource-sendgrid_subuser)\n\nInstallation\n------------\n\n### From Official Release\n\n1. Download the [latest release](https://github.com/digitalocean/terraform-provider-sendgrid/releases/latest) for your platform.\n1. Unzip to your [local plugins directory](https://www.terraform.io/docs/configuration/providers.html#third-party-plugins). For example, on linux:\n\n    ```\n    unzip terraform-provider-sendgrid-linux_amd64_v0.0.1.zip -d ~/.terraform.d/plugins\n    ```\n\nConfiguration Example\n-------------------------------\n\n```\n# \u003cmain.tf\u003e\nprovider \"sendgrid\" {\n  api_key = \"SG.abc123\"\n}\n\nresource \"sendgrid_subuser\" \"user1\" {\n  username = \"my-account-subuser1\"\n  email    = \"subuser1@example.org\"\n\n  # A secure password is generated and written to\n  # the destination file.\n  password {\n    destination = \"./output/user1.pass\"\n  }\n\n  # IP addresses assigned to this subuser\n  ips = [\n    \"255.255.255.255\"\n  ]\n}\n\nresource \"sendgrid_api_key\" \"user1\" {\n  name = \"my-account-subuser1\"\n\n  # This API key will be provisioned under my-account-subuser1\n  on_behalf_of = sendgrid_subuser.user1.id\n\n  # The API key will be written to the destination file\n  destination  = \"./output/user1.key\"\n\n  # This key will grant granted permission for the following actions\n  scopes = [\n    \"mail.batch.create\",\n    \"mail.batch.delete\",\n    \"mail.batch.read\",\n    \"mail.batch.update\",\n    \"mail.send\"\n  ]\n}\n\n```\n\nConfiguration Reference\n------------------\n\\* Denotes a required field\n\n### provider \"sendgrid\"\n| Field    | Type   | Description                                                                                                          |\n|----------|--------|----------------------------------------------------------------------------------------------------------------------|\n| api_key* | string | The API key used to interact with Sendgrid. This can also be supplied via the SENDGRID_API_KEY environment variable. |\n\nExample\n```\nprovider \"sendgrid\" {\n  api_key = \"SG.abc123\"\n}\n```\n\n### resource \"sendgrid_api_key\"\n| Field        | Type        | Description                                                                                                                                                                       |\n|--------------|-------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| destination* | string      | A file that will be created to store the newly created API key. If the full path does not exist, it will be created. Care should be taken to keep the contents of this file safe. |\n| name*        | string      | The name used to describe the created API key.                                                                                                                                    |\n| on_behalf_of | string      | The subuser under which to create the API key. Default is empty.                                                                                                                 |\n| scopes*      | set(string) | A set of permissions given to the created API key. See the [Sendgrid Documentation](https://sendgrid.com/docs/API_Reference/Web_API_v3/API_Keys/api_key_permissions_list.html) for more information.                                                                           |\n\n**Note** the resource will be destroyed and recreated if any of the `on_behalf_of` or `destination` fields are updated.\n\nExample\n```\nresource \"sendgrid_api_key\" \"user1\" {\n  name = \"my-api-key\"\n  on_behalf_of = \"my-account-subuser1\"\n  destination  = \"./output/user1.key\"\n  scopes = [\n    \"mail.send\"\n  ]\n}\n```\n\nImporting an existing API key\n```\n# import subuser on_behalf_of's key\nterraform import sendgrid_api_key.apikey1 api_key_id:destination:on_behalf_of\n\n# on_behalf_of may be left empty\nterraform import sendgrid_api_key.apikey1 api_key_id:destination:\n```\n\n### resource \"sendgrid_subuser\"\n| Field                 | Type    | Description                                                                                                                                                                          |\n|-----------------------|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| disabled              | boolean | Set to true if this subuser should temporarily lose the ability to perform actions. Default is false.                                                                                |\n| domain                | string  | The authenticated domain ID from which this user is allowed to send email. Note that this is the domain ID and *not* the domain name itself. Default is \"0\" (built-in Sendgrid ID).                                                                    |\n| email*                | string  | The email address of the subuser.                                                                                                                                                    |\n| password*             |         |                                                                                                                                                                                      |\n| password.destination* | string  | A file that will be created to store the newly generated password. If the full path does not exist, it will be created. Care should be taken to keep the contents of this file safe. |\n| password.length       | int     | The length of the password to be generated. Default is 16 characters.                                                                                                                |\n| username*             | string  | The username of the subuser.                                                                                                                                                         |\n\n**Note** the resource will be destroyed and recreated if any of the `email`, `password`, or `username` fields are updated.\n\nExample\n```\nresource \"sendgrid_subuser\" \"user1\" {\n  username = \"my-account-subuser1\"\n  email    = \"subuser1@example.org\"\n\n  password {\n    destination = \"./output/user1.pass\"\n    length = 32\n  }\n\n  domain = \"112233\"\n\n  disabled = true\n\n  ips = [\n    \"255.255.255.254\",\n    \"255.255.255.255\"\n  ]\n}\n```\n\nImporting an existing subuser\n```\nterraform import sendgrid_subuser.user1 username:password_destination:password_length\n```\n\nContributing\n============\n\nGetting Started\n---------------\n\nThis provider requires a working installation of Go that is compatible with [Go Modules](https://blog.golang.org/using-go-modules).\n\n1. Clone the repository\n    ```\n    git clone https://github.com/digitalocean/terraform-provider-sendgrid.git\n    ```\n2. Build the `terraform-provider-sendgrid` plugin, which produces a binary in the current working directory.\n    ```\n    make build\n\n    # Alternatively, build and init terraform\n    make init\n    ```\n3. Write a `main.tf` configuration file, which can then be planned and applied with `make plan` and `make apply`.\n4. Destroy any test resources with `make destroy`.\n\nRunning Acceptance Tests\n------------------------\n\nAcceptance tests currently require at least Sendgrid Pro account, in order to test subuser management with assigned IP addresses. The `SENDGRID_API_KEY` environment variable must be set to your Sendgrid API key, and `SENDGRID_TEST_IPS` must be set to a JSON array of IP addresses to be assigned to test subusers. For example:\n\n```\nSENDGRID_API_KEY=\"SG.abc123\" SENDGRID_TEST_IPS='[\"255.255.255.255\"]' make testacc\n```\n\nCreating a Release\n------------------------\n\n1. Set environment variable `RELEASE_VERSION=vX.Y.Z` where `X.Y.Z` follows [semantic versioning](https://semver.org/) guidelines.\n1. Create and push a new tag. E.g., `git tag -a $RELEASE_VERSION -m \"Create release $RELEASE_VERSION\" \u0026\u0026 git push origin $RELEASE_VERSION`\n1. Run `make release` to build the plugin binaries under the `bin/` directory and package them into `.zip` files for each target platform.\n1. Create a new release on GitHub, and write an appropriate description. Ensure the tag version is set to the same value as `RELEASE_VERSION`.\n1. Attach each `.zip` file as an asset.\n1. Publish the release.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigitalocean%2Fterraform-provider-sendgrid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdigitalocean%2Fterraform-provider-sendgrid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigitalocean%2Fterraform-provider-sendgrid/lists"}