Skip to content

Instantly share code, notes, and snippets.

@ripienaar
Last active March 6, 2020 09:55
Show Gist options
  • Save ripienaar/2f38efee11225d7c6514cb680a14bca2 to your computer and use it in GitHub Desktop.
Save ripienaar/2f38efee11225d7c6514cb680a14bca2 to your computer and use it in GitHub Desktop.
% terraform apply
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
# jetstream_stream.ORDERS will be created
+ resource "jetstream_stream" "ORDERS" {
+ ack = true
+ id = (known after apply)
+ max_age = "-1"
+ max_bytes = -1
+ max_consumers = -1
+ max_msg_size = -1
+ max_msgs = -1
+ name = "ORDERS"
+ replicas = 1
+ retention = "limits"
+ storage = "memory"
+ subjects = [
+ "ORDERS.*",
+ "OTHER.*",
]
}
Plan: 1 to add, 0 to change, 0 to destroy.
Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.
Enter a value: yes
jetstream_stream.ORDERS: Creating...
jetstream_stream.ORDERS: Creation complete after 0s [id=ORDERS]
Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
# REMOVE THE "OTHER.*" SUBJECT FROM main.tf
% vi main.tf
% terraform apply <10:52:58
jetstream_stream.ORDERS: Refreshing state... [id=ORDERS]
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
~ update in-place
Terraform will perform the following actions:
# jetstream_stream.ORDERS will be updated in-place
~ resource "jetstream_stream" "ORDERS" {
ack = true
id = "ORDERS"
max_age = "-1"
max_bytes = -1
max_consumers = -1
max_msg_size = -1
max_msgs = -1
name = "ORDERS"
replicas = 1
retention = "limits"
storage = "memory"
~ subjects = [
"ORDERS.*",
- "OTHER.*",
]
}
Plan: 0 to add, 1 to change, 0 to destroy.
Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.
Enter a value: yes
jetstream_stream.ORDERS: Modifying... [id=ORDERS]
jetstream_stream.ORDERS: Modifications complete after 0s [id=ORDERS]
Apply complete! Resources: 0 added, 1 changed, 0 destroyed.
# NOTHING SHOULD BE CHANGING NOW
% terraform apply
jetstream_stream.ORDERS: Refreshing state... [id=ORDERS]
Apply complete! Resources: 0 added, 0 changed, 0 destroyed.
% terraform destroy
jetstream_stream.ORDERS: Refreshing state... [id=ORDERS]
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
- destroy
Terraform will perform the following actions:
# jetstream_stream.ORDERS will be destroyed
- resource "jetstream_stream" "ORDERS" {
- ack = true -> null
- id = "ORDERS" -> null
- max_age = "-1" -> null
- max_bytes = -1 -> null
- max_consumers = -1 -> null
- max_msg_size = -1 -> null
- max_msgs = -1 -> null
- name = "ORDERS" -> null
- replicas = 1 -> null
- retention = "limits" -> null
- storage = "memory" -> null
- subjects = [
- "ORDERS.*",
] -> null
}
Plan: 0 to add, 0 to change, 1 to destroy.
Do you really want to destroy all resources?
Terraform will destroy all your managed infrastructure, as shown above.
There is no undo. Only 'yes' will be accepted to confirm.
Enter a value: yes
jetstream_stream.ORDERS: Destroying... [id=ORDERS]
jetstream_stream.ORDERS: Destruction complete after 0s
Destroy complete! Resources: 1 destroyed.
# ALL GONE
% nats str ls
No Streams defined
provider "jetstream" {
servers = "localhost"
}
resource "jetstream_stream" "ORDERS" {
name = "ORDERS"
subjects = ["ORDERS.*", "OTHER.*"]
storage = "memory"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment