Use-cases
Create or Update agent pools to allow more granular scoping.
Attempted Solutions
Attempted to create an agent pool with a workspace attached - pool created, but workspace did not attach.
Proposal
Bring parity between python-tfe and existing API payloads.
Currently
As of now, work so far is limited to only organization wide or workspace.
class AgentPoolCreateOptions(BaseModel):
"""Options for creating an agent pool."""
# Required: A name to identify the agent pool
name: str
# Optional: Whether the agent pool is organization scoped
organization_scoped: bool | None = None
# Optional: Allowed workspace policy
allowed_workspace_policy: AgentPoolAllowedWorkspacePolicy | None = None
class AgentPoolUpdateOptions(BaseModel):
"""Options for updating an agent pool."""
# Optional: A name to identify the agent pool
name: str | None = None
# Optional: Whether the agent pool is organization scoped
organization_scoped: bool | None = None
# Optional: Allowed workspace policy
allowed_workspace_policy: AgentPoolAllowedWorkspacePolicy | None = None
I'm not sure if we need the excluded options, I will have to see how that works.
Proposed
class AgentPoolCreateOptions(BaseModel):
"""Options for creating an agent pool."""
# Required: A name to identify the agent pool
name: str
# Optional: Whether the agent pool is organization scoped
organization_scoped: bool | None = None
# Optional: Allowed workspace policy
allowed_workspace_policy: AgentPoolAllowedWorkspacePolicy | None = None
# Optional: Allowed project policy
allowed_project_policy: AgentPoolAllowedProjectPolicy | None = None
# Optional: List of workspace IDs that are allowed to use this agent pool
allowed_workspace_ids: list[str] = Field(default_factory=list)
# Optional: List of project IDs that are allowed to use this agent pool
allowed_project_ids: list[str] = Field(default_factory=list)
# Optional: List of workspace IDs excluded from using this agent pool
excluded_workspace_ids: list[str] = Field(default_factory=list)
# Optional: HCP Terraform feature only
allowed_stack_ids: list[str] = Field(default_factory=list)
# Optional: HCP Terraform feature only
excluded_stack_ids: list[str] = Field(default_factory=list)
# Optional: HCP Terraform premium feature only
allowed_module_ids: list[str] = Field(default_factory=list)
# Optional: HCP Terraform premium feature only
excluded_module_ids: list[str] = Field(default_factory=list)
class AgentPoolUpdateOptions(BaseModel):
"""Options for updating an agent pool."""
# Optional: A name to identify the agent pool
name: str | None = None
# Optional: Whether the agent pool is organization scoped
organization_scoped: bool | None = None
# Optional: Allowed workspace policy
allowed_workspace_policy: AgentPoolAllowedWorkspacePolicy | None = None
# Optional: List of workspace IDs that are allowed to use this agent pool
allowed_workspace_ids: list[str] | None = None
# Optional: List of project IDs that are allowed to use this agent pool
allowed_project_ids: list[str] | None = None
# Optional: List of workspace IDs excluded from using this agent pool
excluded_workspace_ids: list[str] | None = None
# Optional: List of stack IDs that are allowed to use this agent pool (HCP Terraform only)
allowed_stack_ids: list[str] | None = None
# Optional: List of stack IDs excluded from using this agent pool (HCP Terraform only)
excluded_stack_ids: list[str] | None = None
# Optional: List of registry module IDs allowed to use this agent pool (enterprise-testing only)
allowed_module_ids: list[str] | None = None
# Optional: List of registry module IDs excluded from using this agent pool (enterprise-testing only)
excluded_module_ids: list[str] | None = None
Tasks
Use-cases
Create or Update agent pools to allow more granular scoping.
Attempted Solutions
Attempted to create an agent pool with a workspace attached - pool created, but workspace did not attach.
Proposal
Bring parity between python-tfe and existing API payloads.
Currently
As of now, work so far is limited to only organization wide or workspace.
I'm not sure if we need the excluded options, I will have to see how that works.
Proposed
Tasks