Provides management of organizations, projects and collaborators using personal access tokens.
Requires Terraform 0.12.x
Clone the repo and build the binary (requires Go +1.14)
go build -o terraform-provider-bugsnag
Install the plugin by copying the binary to your plugin directory. See Terraform - Third party plugins for details about where to copy the binary. More details about how plugins are discovered can be found here.
To install the plugin locally, copy the terraform-provider-bugsnag
executable to your running folder and re-run terraform init
to make terraform aware of your local provider executable.
For examples... (coming soon)
The Bugsnag provider is used to interact with Bugsnag organization related resources.
The provider needs to be configured with a Personal Auth Token, which will be restricted to a single organization. Only settings, projects and collaborators that the token can access will be accessible.
Multiple provider instances should be used for managing multiple organizations.
provider "bugsnag" {
auth_token = "${var.bugsnag_auth_token}"
}
auth_token
- (Required) This is the Bugsnag personal auth token. It can also be provided from theBUGSNAG_DATA_ACCESS_TOKEN
environment variable.
Use this data source to provide a list of projects that can be accessed, using an optional search query
data "bugsnag_projects" "example" {
query = "Website"
sort = "name"
direction = "asc"
}
query
- (Optional) Filter the projects with names matching this query value. Defaults to no filtering.sort
- (Optional) Sort the projects by eithercreated_at
,name
orfavorite
. Defaults tocreated_at
direction
- (Optional) Which direction to sort the projects, eitherasc
ordesc
. Defaults toasc
when sorting by favorite,desc
otherwise.
id
- The ID of the project (e.g.5ed73feb00002b509b040000
)name
- The name of the project (e.g.Website Frontend
)api_key
- The API key for the project (e.g.86925ec410def315d6d2bffd91f51da1
)
This resource allows the organization associated with the access token can be updated. There should only be one resource of this type.
NOTE that this resource cannot be created or deleted.
To manage this resource, it should be imported
terraform import bugsnag_current_org.<resource_name> ""
and removed from the state if its no longer being managed using
terraform state rm bugsnag_current_org.<resource_name>
resource "bugsnag_current_org" "example" {
name = "Example Org"
}
name
(Optional) - The name of the organizationbilling_emails
(Optional) - A list of email addresses to send invoice information to. Setting this as empty indicates the only billing email should be the creators email.auto_upgrade
(Optional) - Whether the organizations plan is upgraded in response to the organization reaching its plan limit of events. If this value is false your events will be throttled when you reach your plan limit.
slug
- The organizations slug used in the URLs (e.g.example-org
)creator
- Contains details about the creator of the organizationemail
- The email address of the organizations creator (e.grichard.jones@example.com
)id
- - The ID of the organizations creator (e.g.86925ec410def315d6d2bffd91f51da1
)name
- The name of the organizations creator (e.g.Richard Jones
)
created_at
- The date and time the organization was created (e.g.2017-04-24T22:17:13.000Z
)updated_at
- The date and time the organization was last updated at (e.g.2017-04-24T22:17:13.000Z
)
This resource allows you to create and manage projects within your Bugsnag organizations.
resource "bugsnag_project" "example" {
name = "Example iOS App"
type = "ios"
}
name
(Required) - The name of the projecttype
(Required) - The language and/or framework of the project. See Creating a Project in the Bugsnag data access API undertype
for possible valid values.
api_key
- The API key for the project (e.g.86925ec410def315d6d2bffd91f51da1
)slug
- The projects slug used in the URLs (e.g.example-ios-app
)html_url
- The URL to the Bugsnag dashboard for this project (e.g.https://app.bugsnag.com/example-org/example-ios-app
)created_at
- The date and time the project was created (e.g.2017-04-24T22:17:13.000Z
)updated_at
- The date and time the project was last updated at (e.g.2017-04-24T22:17:13.000Z
)
This resource allows you to invite and manage collaborators.
resource "bugsnag_project" "example_ios_app" {
name = "Example iOS App"
type = "ios"
}
resource "bugsnag_project" "example_android_app" {
name = "Example Android App"
type = "android"
}
resource "bugsnag_collaborator" "example_non_admin" {
email = "richard.jones@example.com"
project_ids = [
bugsnag_project.example_ios_app.id,
bugsnag_project.example_android_app.id
]
}
resource "bugsnag_collaborator" "example_admin" {
email = "lucy.simmons@example.com"
admin = true
email
(Required) - The email address of the collaboratoradmin
(Optional) - Set totrue
if the collaborator should have admin access to the organization. Defaults tofalse
. Theproject_ids
field must be blank if admin is set totrue
project_ids
(Optional) - A list of project IDs the collaborator should have access to. Should only be provided when admin is set tofalse
name
- The name of the collaboratortwo_factor_enabled
- Set totrue
if 2FA has is enabled for this usertwo_factor_enabled_on
- The date and time 2FA was enabled for this user, if it is active (e.g.2017-04-24T22:17:13.000Z
)recovery_codes_remaining
- The number of two factor recovery codes the User has left. (e.g.2
)password_updated_on
- The date and time the users password was last changed (e.g.2017-04-24T22:17:13.000Z
)show_time_in_utc
- Set totrue
if the user has opted to have times displayed in UTC instead of local timecreated_at
- The date and time the project was created (e.g.2017-04-24T22:17:13.000Z
)pending_invitation
- Set totrue
if the user has not yet accepted their Bugsnag invitationlast_request_at
- The last time the user interacted with the Bugsnag dashboard or related APIs. This is not set if the user has not interacted with the dashboard before (e.g.2017-04-24T22:17:13.000Z
)paid_for
- Set totrue
if the user has Bugsnag dashboard access under the organization's current plan. If this isfalse
for a collaborator, they will see a "locked out" message when they attempt to log in to the Bugsnag dashboard