Intention
Intentions are used to define rules for which services may connect to one another when using Consul Connect.
It is appropriate to either reference existing services or specify non-existent services
that will be created in the future when creating intentions. This resource can be used
in conjunction with the consul..Service datasource when referencing services
registered on nodes that have a running Consul agent.
Example Usage
using Pulumi;
using Consul = Pulumi.Consul;
class MyStack : Stack
{
public MyStack()
{
var database = new Consul.Intention("database", new Consul.IntentionArgs
{
Action = "allow",
DestinationName = "db",
SourceName = "api",
});
}
}
Coming soon!
import pulumi
import pulumi_consul as consul
database = consul.Intention("database",
action="allow",
destination_name="db",
source_name="api")import * as pulumi from "@pulumi/pulumi";
import * as consul from "@pulumi/consul";
const database = new consul.Intention("database", {
action: "allow",
destinationName: "db",
sourceName: "api",
});Create a Intention Resource
new Intention(name: string, args: IntentionArgs, opts?: CustomResourceOptions);def Intention(resource_name, opts=None, action=None, description=None, destination_name=None, destination_namespace=None, meta=None, source_name=None, source_namespace=None, __props__=None);func NewIntention(ctx *Context, name string, args IntentionArgs, opts ...ResourceOption) (*Intention, error)public Intention(string name, IntentionArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args IntentionArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args IntentionArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args IntentionArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
Intention Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The Intention resource accepts the following input properties:
- Action string
The intention action. Must be one of
allowordeny.- Destination
Name string The name of the destination service for the intention. This service does not have to exist.
- Source
Name string The name of the source service for the intention. This service does not have to exist.
- Description string
Optional description that can be used by Consul tooling, but is not used internally.
- Destination
Namespace string The destination namespace of the intention.
- Meta Dictionary<string, string>
Key/value pairs that are opaque to Consul and are associated with the intention.
- Source
Namespace string The source namespace of the intention.
- Action string
The intention action. Must be one of
allowordeny.- Destination
Name string The name of the destination service for the intention. This service does not have to exist.
- Source
Name string The name of the source service for the intention. This service does not have to exist.
- Description string
Optional description that can be used by Consul tooling, but is not used internally.
- Destination
Namespace string The destination namespace of the intention.
- Meta map[string]string
Key/value pairs that are opaque to Consul and are associated with the intention.
- Source
Namespace string The source namespace of the intention.
- action string
The intention action. Must be one of
allowordeny.- destination
Name string The name of the destination service for the intention. This service does not have to exist.
- source
Name string The name of the source service for the intention. This service does not have to exist.
- description string
Optional description that can be used by Consul tooling, but is not used internally.
- destination
Namespace string The destination namespace of the intention.
- meta {[key: string]: string}
Key/value pairs that are opaque to Consul and are associated with the intention.
- source
Namespace string The source namespace of the intention.
- action str
The intention action. Must be one of
allowordeny.- destination_
name str The name of the destination service for the intention. This service does not have to exist.
- source_
name str The name of the source service for the intention. This service does not have to exist.
- description str
Optional description that can be used by Consul tooling, but is not used internally.
- destination_
namespace str The destination namespace of the intention.
- meta Dict[str, str]
Key/value pairs that are opaque to Consul and are associated with the intention.
- source_
namespace str The source namespace of the intention.
Outputs
All input properties are implicitly available as output properties. Additionally, the Intention resource produces the following output properties:
Look up an Existing Intention Resource
Get an existing Intention resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: IntentionState, opts?: CustomResourceOptions): Intentionstatic get(resource_name, id, opts=None, action=None, description=None, destination_name=None, destination_namespace=None, meta=None, source_name=None, source_namespace=None, __props__=None);func GetIntention(ctx *Context, name string, id IDInput, state *IntentionState, opts ...ResourceOption) (*Intention, error)public static Intention Get(string name, Input<string> id, IntentionState? state, CustomResourceOptions? opts = null)- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
The following state arguments are supported:
- Action string
The intention action. Must be one of
allowordeny.- Description string
Optional description that can be used by Consul tooling, but is not used internally.
- Destination
Name string The name of the destination service for the intention. This service does not have to exist.
- Destination
Namespace string The destination namespace of the intention.
- Meta Dictionary<string, string>
Key/value pairs that are opaque to Consul and are associated with the intention.
- Source
Name string The name of the source service for the intention. This service does not have to exist.
- Source
Namespace string The source namespace of the intention.
- Action string
The intention action. Must be one of
allowordeny.- Description string
Optional description that can be used by Consul tooling, but is not used internally.
- Destination
Name string The name of the destination service for the intention. This service does not have to exist.
- Destination
Namespace string The destination namespace of the intention.
- Meta map[string]string
Key/value pairs that are opaque to Consul and are associated with the intention.
- Source
Name string The name of the source service for the intention. This service does not have to exist.
- Source
Namespace string The source namespace of the intention.
- action string
The intention action. Must be one of
allowordeny.- description string
Optional description that can be used by Consul tooling, but is not used internally.
- destination
Name string The name of the destination service for the intention. This service does not have to exist.
- destination
Namespace string The destination namespace of the intention.
- meta {[key: string]: string}
Key/value pairs that are opaque to Consul and are associated with the intention.
- source
Name string The name of the source service for the intention. This service does not have to exist.
- source
Namespace string The source namespace of the intention.
- action str
The intention action. Must be one of
allowordeny.- description str
Optional description that can be used by Consul tooling, but is not used internally.
- destination_
name str The name of the destination service for the intention. This service does not have to exist.
- destination_
namespace str The destination namespace of the intention.
- meta Dict[str, str]
Key/value pairs that are opaque to Consul and are associated with the intention.
- source_
name str The name of the source service for the intention. This service does not have to exist.
- source_
namespace str The source namespace of the intention.
Package Details
- Repository
- https://github.com/pulumi/pulumi-consul
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
consulTerraform Provider.