This repository has been archived by the owner on Mar 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implement new resource resource_rollbar_team_project_association (#59)
- Loading branch information
Showing
21 changed files
with
330 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
--- | ||
layout: "rollbar" | ||
page_title: "Rollbar: rollbar_team_project_association" | ||
sidebar_current: "docs-rollbar-resource-team-project-association" | ||
description: |- | ||
Provides a resource to create and manage the association between a team and project. | ||
--- | ||
|
||
# rollbar_team_project_association | ||
|
||
This resource is used to create and manage the association between a team and project. | ||
|
||
## Example Usage | ||
|
||
```hcl-terraform | ||
resource "rollbar_team" "foobar" { | ||
name = "my_team" | ||
access_level = "standard" | ||
} | ||
resource "rollbar_project" "foobar" { | ||
name = "my_project" | ||
} | ||
resource "rollbar_team_project_association" "foobar" { | ||
team_id = rollbar_team.foobar.id | ||
project_id = rollbar_project.foobar.id | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
|
||
The following arguments are supported: | ||
|
||
* `team_id` - (Required) `<string>` ID of existing team. | ||
|
||
* `project_id` - (Required) `<string>` ID of existing project. | ||
|
||
## Attributes Reference | ||
|
||
n/a | ||
|
||
## Import | ||
|
||
Existing team project association can be imported using a composite value of the team and project ID | ||
separated by a colon. | ||
|
||
For example: | ||
|
||
```shell | ||
$ terraform import rollbar_team_project_association.follbar 123:456 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package rollbar | ||
|
||
import ( | ||
"fmt" | ||
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" | ||
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" | ||
"github.com/hashicorp/terraform-plugin-sdk/v2/terraform" | ||
"testing" | ||
) | ||
|
||
func TestAccRollbarTeamProjectAssociation_importBasic(t *testing.T) { | ||
teamName := fmt.Sprintf("team-%s", acctest.RandString(10)) | ||
projectName := fmt.Sprintf("project-%s", acctest.RandString(10)) | ||
|
||
resource.Test(t, resource.TestCase{ | ||
PreCheck: func() { | ||
testAccPreCheck(t) | ||
}, | ||
Providers: testAccProviders, | ||
Steps: []resource.TestStep{ | ||
{ | ||
Config: testAccCheckRollbarTeamProjectAssociation_basic(teamName, projectName), | ||
}, | ||
{ | ||
ResourceName: "rollbar_team_project_association.foobar", | ||
ImportState: true, | ||
ImportStateVerify: true, | ||
ImportStateIdFunc: testAccRollbarTeamProjectAssociationImportStateIdFunc( | ||
"rollbar_team_project_association.foobar"), | ||
}, | ||
}, | ||
}) | ||
} | ||
|
||
func testAccRollbarTeamProjectAssociationImportStateIdFunc(resourceName string) resource.ImportStateIdFunc { | ||
return func(s *terraform.State) (string, error) { | ||
rs, ok := s.RootModule().Resources[resourceName] | ||
if !ok { | ||
return "", fmt.Errorf("not found: %s", resourceName) | ||
} | ||
|
||
return fmt.Sprintf("%s:%s", rs.Primary.Attributes["team_id"], | ||
rs.Primary.Attributes["project_id"]), nil | ||
} | ||
} |
Oops, something went wrong.