- K8S: Kubernetes clusters
- ECS: Amazon Elastic Container Service clusters
- S3: Amazon S3 buckets
- docker: Docker containers
- server: Bare-metal or VM servers
- lambda: AWS Lambda functions
For aggregating multiple physical environments into logical groups, use the
kosli_logical_environment resource.To attach compliance policies to environments, use the
kosli_policy_attachment resource.Example usage
Environment types
Thetype attribute must be one of the following physical environment types:
K8S- Kubernetes clustersECS- Amazon Elastic Container ServiceS3- Amazon S3 bucketsdocker- Docker containersserver- Bare-metal or VM serverslambda- AWS Lambda functions
Configuration options
Include scaling
Theinclude_scaling attribute (default: false) determines whether scaling events in the environment should be tracked. This is useful for environments with auto-scaling where you want to monitor scale-up and scale-down events.
Import
Environments can be imported using their name:Monitoring environments
For querying environment metadata such aslast_modified_at and last_reported_at timestamps, use the kosli_environment data source. This is useful for monitoring and creating conditional logic based on environment state.
Schema
Required
name(String) Name of the environment. Must be unique within the organization. Changing this will force recreation of the resource.type(String) Type of the environment. Valid values:K8S,ECS,S3,docker,server,lambda. Changing this will force recreation of the resource.
Optional
description(String) Description of the environment. Explains the purpose and characteristics of this deployment target.include_scaling(Boolean) Whether to include scaling information when reporting environment snapshots. Defaults tofalse.