-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c325dcb
commit c98e7b1
Showing
147 changed files
with
2,860 additions
and
3,364 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,36 +19,34 @@ for Business account. | |
|
||
In this example, the agent pool and workspace are connected through other resources that manage the agent pool permissions as well as the workspace execution mode. Notice that the `TfeWorkspaceSettings` uses the agent pool reference found in `TfeAgentPoolAllowedWorkspaces` in order to create the permission to use the agent pool before assigning it. | ||
|
||
```hcl | ||
resource "tfe_organization" "test-organization" { | ||
name = "my-org-name" | ||
email = "[email protected]" | ||
} | ||
// Ensure workspace and agent pool are create first | ||
resource "tfe_workspace" "test-workspace" { | ||
name = "my-workspace-name" | ||
organization = tfe_organization.test-organization.name | ||
} | ||
resource "tfe_agent_pool" "test-agent-pool" { | ||
name = "my-agent-pool-name" | ||
organization = tfe_organization.test-organization.name | ||
organization_scoped = false | ||
} | ||
// Ensure permissions are assigned second | ||
resource "tfe_agent_pool_allowed_workspaces" "allowed" { | ||
agent_pool_id = tfe_agent_pool.test-agent-pool.id | ||
allowed_workspace_ids = [for key, value in tfe_workspace.test.*.id : value] | ||
} | ||
// Lastly, ensure the workspace agent execution is assigned last by | ||
// referencing allowed_workspaces | ||
resource "tfe_workspace_settings" "test-workspace-settings" { | ||
workspace_id = tfe_workspace.test-workspace.id | ||
execution_mode = "agent" | ||
agent_pool_id = tfe_agent_pool_allowed_workspaces.allowed.id | ||
```csharp | ||
using Constructs; | ||
using HashiCorp.Cdktf; | ||
/*Provider bindings are generated by running cdktf get. | ||
See https://cdk.tf/provider-generation for more details.*/ | ||
using Gen.Providers.Tfe; | ||
class MyConvertedCode : TerraformStack | ||
{ | ||
public MyConvertedCode(Construct scope, string name) : base(scope, name) | ||
{ | ||
var tfeOrganizationTestOrganization = new Organization.Organization(this, "test-organization", new OrganizationConfig { | ||
Email = "[email protected]", | ||
Name = "my-org-name" | ||
}); | ||
var tfeWorkspaceTestWorkspace = new Workspace.Workspace(this, "test-workspace", new WorkspaceConfig { | ||
Name = "my-workspace-name", | ||
Organization = Token.AsString(tfeOrganizationTestOrganization.Name) | ||
}); | ||
var tfeAgentPoolTestAgentPool = new AgentPool.AgentPool(this, "test-agent-pool", new AgentPoolConfig { | ||
Name = "my-agent-pool-name", | ||
Organization = Token.AsString(tfeOrganizationTestOrganization.Name), | ||
OrganizationScoped = false | ||
}); | ||
new AgentPoolAllowedWorkspaces.AgentPoolAllowedWorkspaces(this, "test-allowed-workspaces", new AgentPoolAllowedWorkspacesConfig { | ||
AgentPoolId = Token.AsString(tfeAgentPoolTestAgentPool.Id), | ||
AllowedWorkspaceIds = new [] { Token.AsString(tfeWorkspaceTestWorkspace.Id) } | ||
}); | ||
} | ||
} | ||
``` | ||
|
||
|
@@ -68,4 +66,5 @@ A resource can be imported; use `<AGENT POOL ID>` as the import ID. For example: | |
terraform import tfe_agent_pool_allowed_workspaces.foobar apool-rW0KoLSlnuNb5adB | ||
``` | ||
|
||
<!-- cache-key: cdktf-0.17.0-pre.15 input-de3bb23c998fa1d7b1d6fadb2f671fda9e7a1f166eb6c368662962f9be2af35f --> | ||
|
||
<!-- cache-key: cdktf-0.17.0-pre.15 input-9d6c804f088514863a2d3b994f35e4cd7e510b8364e61ba1fa41165766b7d693 --> |
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 |
---|---|---|
|
@@ -19,36 +19,42 @@ for Business account. | |
|
||
In this example, the agent pool and workspace are connected through other resources that manage the agent pool permissions as well as the workspace execution mode. Notice that the `TfeWorkspaceSettings` uses the agent pool reference found in `TfeAgentPoolAllowedWorkspaces` in order to create the permission to use the agent pool before assigning it. | ||
|
||
```hcl | ||
resource "tfe_organization" "test-organization" { | ||
name = "my-org-name" | ||
email = "[email protected]" | ||
```go | ||
import constructs "github.com/aws/constructs-go/constructs" | ||
import "github.com/hashicorp/terraform-cdk-go/cdktf" | ||
/*Provider bindings are generated by running cdktf get. | ||
See https://cdk.tf/provider-generation for more details.*/ | ||
import "github.com/aws-samples/dummy/gen/providers/tfe/organization" | ||
import "github.com/aws-samples/dummy/gen/providers/tfe/workspace" | ||
import "github.com/aws-samples/dummy/gen/providers/tfe/agentPool" | ||
import "github.com/aws-samples/dummy/gen/providers/tfe/agentPoolAllowedWorkspaces" | ||
type myConvertedCode struct { | ||
terraformStack | ||
} | ||
|
||
// Ensure workspace and agent pool are create first | ||
resource "tfe_workspace" "test-workspace" { | ||
name = "my-workspace-name" | ||
organization = tfe_organization.test-organization.name | ||
} | ||
resource "tfe_agent_pool" "test-agent-pool" { | ||
name = "my-agent-pool-name" | ||
organization = tfe_organization.test-organization.name | ||
organization_scoped = false | ||
} | ||
// Ensure permissions are assigned second | ||
resource "tfe_agent_pool_allowed_workspaces" "allowed" { | ||
agent_pool_id = tfe_agent_pool.test-agent-pool.id | ||
allowed_workspace_ids = [for key, value in tfe_workspace.test.*.id : value] | ||
} | ||
// Lastly, ensure the workspace agent execution is assigned last by | ||
// referencing allowed_workspaces | ||
resource "tfe_workspace_settings" "test-workspace-settings" { | ||
workspace_id = tfe_workspace.test-workspace.id | ||
execution_mode = "agent" | ||
agent_pool_id = tfe_agent_pool_allowed_workspaces.allowed.id | ||
func newMyConvertedCode(scope construct, name *string) *myConvertedCode { | ||
this := &myConvertedCode{} | ||
cdktf.NewTerraformStack_Override(this, scope, name) | ||
tfeOrganizationTestOrganization := organization.NewOrganization(this, jsii.String("test-organization"), &organizationConfig{ | ||
email: jsii.String("[email protected]"), | ||
name: jsii.String("my-org-name"), | ||
}) | ||
tfeWorkspaceTestWorkspace := workspace.NewWorkspace(this, jsii.String("test-workspace"), &workspaceConfig{ | ||
name: jsii.String("my-workspace-name"), | ||
organization: cdktf.Token_AsString(tfeOrganizationTestOrganization.name), | ||
}) | ||
tfeAgentPoolTestAgentPool := agentPool.NewAgentPool(this, jsii.String("test-agent-pool"), &agentPoolConfig{ | ||
name: jsii.String("my-agent-pool-name"), | ||
organization: cdktf.Token_*AsString(tfeOrganizationTestOrganization.name), | ||
organizationScoped: jsii.Boolean(false), | ||
}) | ||
agentPoolAllowedWorkspaces.NewAgentPoolAllowedWorkspaces(this, jsii.String("test-allowed-workspaces"), &agentPoolAllowedWorkspacesConfig{ | ||
agentPoolId: cdktf.Token_*AsString(tfeAgentPoolTestAgentPool.id), | ||
allowedWorkspaceIds: []*string{ | ||
cdktf.Token_*AsString(tfeWorkspaceTestWorkspace.id), | ||
}, | ||
}) | ||
return this | ||
} | ||
``` | ||
|
||
|
@@ -68,4 +74,5 @@ A resource can be imported; use `<AGENT POOL ID>` as the import ID. For example: | |
terraform import tfe_agent_pool_allowed_workspaces.foobar apool-rW0KoLSlnuNb5adB | ||
``` | ||
|
||
<!-- cache-key: cdktf-0.17.0-pre.15 input-de3bb23c998fa1d7b1d6fadb2f671fda9e7a1f166eb6c368662962f9be2af35f --> | ||
|
||
<!-- cache-key: cdktf-0.17.0-pre.15 input-9d6c804f088514863a2d3b994f35e4cd7e510b8364e61ba1fa41165766b7d693 --> |
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
Oops, something went wrong.