Use-cases
List the stack deployments that belong to a Stack
https://developer.hashicorp.com/terraform/cloud-docs/api-docs/stacks/deployments
https://developer.hashicorp.com/terraform/enterprise/api-docs/stacks/deployments
Attempted Solutions
None, currently unsupported
Proposal
Add support for Stack Deployments as a new resource family in python-tfe.
class StackDeployment(BaseModel):
"""Represents a stack deployment (JSON:API type: stack-deployments)."""
model_config = ConfigDict(populate_by_name=True, validate_by_name=True)
id: str
name: str | None = Field(default=None, alias="name")
- Add Resource in src/pytfe/resources/stack_deployments.py
class StackDeployments(_Service):
def list(
self,
stack_id: str,
options: StackDeploymentListOptions | None = None,
) -> Iterator[StackDeployment]:
"""List all stack deployments for a given stack.
GET /api/v2/stacks/{stack_id}/stack-deployments
"""
- Update Client
- Add Examples under examples folder
- Add Unit tests in tests/units
All new code should follow existing project conventions:
- Pydantic v2 models with populate_by_name=True
- alias-based JSON:API field mapping
- _Service base class
- Iterator-based pagination via _list.
Use-cases
List the stack deployments that belong to a Stack
https://developer.hashicorp.com/terraform/cloud-docs/api-docs/stacks/deployments
https://developer.hashicorp.com/terraform/enterprise/api-docs/stacks/deployments
Attempted Solutions
None, currently unsupported
Proposal
Add support for Stack Deployments as a new resource family in python-tfe.
All new code should follow existing project conventions: