InfluxDB stacks
Use InfluxDB stacks to manage InfluxDB templates. When you apply a template, InfluxDB associates resources in the template with a stack. Use the stack to add, update, or remove InfluxDB templates over time.
Save time with stacks
Discover how to use InfluxDB stacks to save time.
Initialize a stack
InfluxDB automatically creates a new stack each time you apply an InfluxDB template without providing a stack ID. To manually create or initialize a new stack, use the influx stacks init command.
influx apply \
-o example-org \
-f path/to/template.yml
influx stacks init \
-o example-org \
-n "Example Stack" \
-d "InfluxDB stack for monitoring some awesome stuff" \
-u https://example.com/template-1.yml \
-u https://example.com/template-2.yml
Update a stack
Use the influx apply command to update a stack with a modified template. When applying a template to an existing stack, InfluxDB checks to see if the resources in the template match existing resources. InfluxDB updates, adds, and removes resources to resolve differences between the current state of the stack and the newly applied template.
influx apply \
-o example-org \
-u http://example.com/template-1.yml \
-u http://example.com/template-2.yml \
--stack-id=12ab34cd56ef
View stacks
Use the influx stacks command to view installed InfluxDB stacks and their associated resources.
influx stacks -o example-org
Remove a stack
Use the influx stacks remove command to remove an InfluxDB stack and all its associated resources.
influx stacks remove \
-o example-org \
--stack-id=12ab34cd56ef
Key differences between stacks and templates:
- A template defines a set of resources in a text file outside of InfluxDB. When you apply a template, a stack is automatically created to manage the applied template.
- Stacks add, modify or delete resources in an instance.
- Templates do not recognize resources in an instance. All resources in the template are added, creating duplicate resources if a resource already exists.