Namespace Pulumi.Consul
Classes
AclAuthMethod
Starting with Consul 1.5.0, the consul..AclAuthMethod resource can be used to managed Consul ACL auth methods.
Example Usage
using Pulumi;
using Consul = Pulumi.Consul;
class MyStack : Stack
{
public MyStack()
{
var minikube = new Consul.AclAuthMethod("minikube", new Consul.AclAuthMethodArgs
{
Config =
{
{ "CACert", @"-----BEGIN CERTIFICATE-----
...-----END CERTIFICATE-----
" },
{ "Host", "https://192.0.2.42:8443" },
{ "ServiceAccountJWT", "eyJhbGciOiJSUzI1NiIsImtpZCI6IiJ9..." },
},
Description = "dev minikube cluster",
Type = "kubernetes",
});
}
}
AclAuthMethodArgs
AclAuthMethodState
AclBindingRule
Starting with Consul 1.5.0, the consul..AclBindingRule resource can be used to managed Consul ACL binding rules.
Example Usage
using Pulumi;
using Consul = Pulumi.Consul;
class MyStack : Stack
{
public MyStack()
{
var minikube = new Consul.AclAuthMethod("minikube", new Consul.AclAuthMethodArgs
{
Config =
{
{ "CACert", @"-----BEGIN CERTIFICATE-----
...-----END CERTIFICATE-----
" },
{ "Host", "https://192.0.2.42:8443" },
{ "ServiceAccountJWT", "eyJhbGciOiJSUzI1NiIsImtpZCI6IiJ9..." },
},
Description = "dev minikube cluster",
Type = "kubernetes",
});
var test = new Consul.AclBindingRule("test", new Consul.AclBindingRuleArgs
{
AuthMethod = minikube.Name,
BindName = "minikube",
BindType = "service",
Description = "foobar",
Selector = "serviceaccount.namespace==default",
});
}
}
AclBindingRuleArgs
AclBindingRuleState
AclPolicy
Starting with Consul 1.4.0, the consul..AclPolicy can be used to managed Consul ACL policies.
Example Usage
using Pulumi;
using Consul = Pulumi.Consul;
class MyStack : Stack
{
public MyStack()
{
var test = new Consul.AclPolicy("test", new Consul.AclPolicyArgs
{
Datacenters =
{
"dc1",
},
Rules = @"node_prefix """" {
policy = ""read""
}
",
});
}
}
AclPolicyArgs
AclPolicyState
AclRole
Starting with Consul 1.5.0, the consul..AclRole can be used to managed Consul ACL roles.
Example Usage
using Pulumi;
using Consul = Pulumi.Consul;
class MyStack : Stack
{
public MyStack()
{
var read_policy = new Consul.AclPolicy("read-policy", new Consul.AclPolicyArgs
{
Datacenters =
{
"dc1",
},
Rules = "node \"\" { policy = \"read\" }",
});
var read = new Consul.AclRole("read", new Consul.AclRoleArgs
{
Description = "bar",
Policies =
{
read_policy.Id,
},
ServiceIdentities =
{
new Consul.Inputs.AclRoleServiceIdentityArgs
{
ServiceName = "foo",
},
},
});
}
}
AclRoleArgs
AclRoleState
AclToken
The consul..AclToken resource writes an ACL token into Consul.
Example Usage
Basic usage
using Pulumi;
using Consul = Pulumi.Consul;
class MyStack : Stack
{
public MyStack()
{
var agent = new Consul.AclPolicy("agent", new Consul.AclPolicyArgs
{
Rules = @"node_prefix """" {
policy = ""read""
}
",
});
var test = new Consul.AclToken("test", new Consul.AclTokenArgs
{
Description = "my test token",
Local = true,
Policies =
{
agent.Name,
},
});
}
}
AclTokenArgs
AclTokenPolicyAttachment
AclTokenPolicyAttachmentArgs
AclTokenPolicyAttachmentState
AclTokenState
AgentService
!> The consul..AgentService resource has been deprecated in version 2.0.0 of the provider
and will be removed in a future release. Please read the upgrade guide
for more information.
Provides access to the agent service data in Consul. This can be used to define a service associated with a particular agent. Currently, defining health checks for an agent service is not supported.
Example Usage
using Pulumi;
using Consul = Pulumi.Consul;
class MyStack : Stack
{
public MyStack()
{
var app = new Consul.AgentService("app", new Consul.AgentServiceArgs
{
Address = "www.google.com",
Port = 80,
Tags =
{
"tag0",
"tag1",
},
});
}
}
AgentServiceArgs
AgentServiceState
AutopilotConfig
Provides access to the Autopilot Configuration of Consul to automatically manage Consul servers.
It includes to automatically cleanup dead servers, monitor the status of the Raft cluster and stable server introduction.
Example Usage
using Pulumi;
using Consul = Pulumi.Consul;
class MyStack : Stack
{
public MyStack()
{
var config = new Consul.AutopilotConfig("config", new Consul.AutopilotConfigArgs
{
CleanupDeadServers = false,
LastContactThreshold = "1s",
MaxTrailingLogs = 500,
});
}
}
AutopilotConfigArgs
AutopilotConfigState
CatalogEntry
!> The consul..CatalogEntry resource has been deprecated in version 2.0.0 of the provider
and will be removed in a future release. Please read the upgrade guide
for more information.
Registers a node or service with the Consul Catalog. Currently, defining health checks is not supported.
Example Usage
using Pulumi;
using Consul = Pulumi.Consul;
class MyStack : Stack
{
public MyStack()
{
var app = new Consul.CatalogEntry("app", new Consul.CatalogEntryArgs
{
Address = "192.168.10.10",
Node = "foobar",
Services =
{
new Consul.Inputs.CatalogEntryServiceArgs
{
Address = "127.0.0.1",
Id = "redis1",
Name = "redis",
Port = 8000,
Tags =
{
"master",
"v1",
},
},
},
});
}
}
CatalogEntryArgs
CatalogEntryState
Config
ConfigEntry
The Configuration Entry resource can be used to provide cluster-wide defaults for various aspects of Consul.
Example Usage
using System.Collections.Generic;
using System.Text.Json;
using Pulumi;
using Consul = Pulumi.Consul;
class MyStack : Stack
{
public MyStack()
{
var proxyDefaults = new Consul.ConfigEntry("proxyDefaults", new Consul.ConfigEntryArgs
{
Kind = "proxy-defaults",
ConfigJson = JsonSerializer.Serialize(new Dictionary<string, object?>
{
{ "Config", new Dictionary<string, object?>
{
{ "local_connect_timeout_ms", 1000 },
{ "handshake_timeout_ms", 10000 },
} },
}),
});
var web = new Consul.ConfigEntry("web", new Consul.ConfigEntryArgs
{
Kind = "service-defaults",
ConfigJson = JsonSerializer.Serialize(new Dictionary<string, object?>
{
{ "Protocol", "http" },
}),
});
var admin = new Consul.ConfigEntry("admin", new Consul.ConfigEntryArgs
{
Kind = "service-defaults",
ConfigJson = JsonSerializer.Serialize(new Dictionary<string, object?>
{
{ "Protocol", "http" },
}),
});
var serviceResolver = new Consul.ConfigEntry("serviceResolver", new Consul.ConfigEntryArgs
{
Kind = "service-resolver",
ConfigJson = JsonSerializer.Serialize(new Dictionary<string, object?>
{
{ "DefaultSubset", "v1" },
{ "Subsets", new Dictionary<string, object?>
{
{ "v1", new Dictionary<string, object?>
{
{ "Filter", "Service.Meta.version == v1" },
} },
{ "v2", new Dictionary<string, object?>
{
{ "Filter", "Service.Meta.version == v2" },
} },
} },
}),
});
var serviceSplitter = new Consul.ConfigEntry("serviceSplitter", new Consul.ConfigEntryArgs
{
Kind = "service-splitter",
ConfigJson = JsonSerializer.Serialize(new Dictionary<string, object?>
{
{ "Splits", new[]
{
new Dictionary<string, object?>
{
{ "Weight", 90 },
{ "ServiceSubset", "v1" },
},
new Dictionary<string, object?>
{
{ "Weight", 10 },
{ "ServiceSubset", "v2" },
},
}
},
}),
});
var serviceRouter = new Consul.ConfigEntry("serviceRouter", new Consul.ConfigEntryArgs
{
Kind = "service-router",
ConfigJson = JsonSerializer.Serialize(new Dictionary<string, object?>
{
{ "Routes", new[]
{
new Dictionary<string, object?>
{
{ "Match", new Dictionary<string, object?>
{
{ "HTTP", new Dictionary<string, object?>
{
{ "PathPrefix", "/admin" },
} },
} },
{ "Destination", new Dictionary<string, object?>
{
{ "Service", "admin" },
} },
},
}
},
}),
});
}
}
ConfigEntryArgs
ConfigEntryState
GetAclAuthMethod
GetAclAuthMethodArgs
GetAclAuthMethodResult
GetAclPolicy
GetAclPolicyArgs
GetAclPolicyResult
GetAclRole
GetAclRoleArgs
GetAclRoleResult
GetAclToken
GetAclTokenArgs
GetAclTokenResult
GetAclTokenSecretId
GetAclTokenSecretIdArgs
GetAclTokenSecretIdResult
GetAgentConfig
GetAgentConfigResult
GetAgentSelf
GetAgentSelfResult
GetAutopilotHealth
GetAutopilotHealthArgs
GetAutopilotHealthResult
GetCatalogNodes
GetCatalogNodesArgs
GetCatalogNodesResult
GetCatalogService
GetCatalogServiceArgs
GetCatalogServiceResult
GetCatalogServices
GetCatalogServicesArgs
GetCatalogServicesResult
GetKeyPrefix
GetKeyPrefixArgs
GetKeyPrefixResult
GetKeys
GetKeysArgs
GetKeysResult
GetNetworkAreaMembers
GetNetworkAreaMembersArgs
GetNetworkAreaMembersResult
GetNetworkSegments
GetNetworkSegmentsArgs
GetNetworkSegmentsResult
GetNodes
GetNodesArgs
GetNodesResult
GetService
GetServiceArgs
GetServiceHealth
GetServiceHealthArgs
GetServiceHealthResult
GetServiceResult
GetServices
GetServicesArgs
GetServicesResult
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",
});
}
}
IntentionArgs
IntentionState
KeyPrefix
KeyPrefixArgs
KeyPrefixState
Keys
KeysArgs
KeysState
License
NOTE: This feature requires Consul Enterprise.
The consul..License resource provides datacenter-level management of
the Consul Enterprise license. If ACLs are enabled then a token with operator
privileges may be required in order to use this command.
Example Usage
using System.IO;
using Pulumi;
using Consul = Pulumi.Consul;
class MyStack : Stack
{
public MyStack()
{
var license = new Consul.License("license", new Consul.LicenseArgs
{
License = File.ReadAllText("license.hclic"),
});
}
}
LicenseArgs
LicenseState
Namespace
NOTE: This feature requires Consul Enterprise.
The consul..Namespace resource provides isolated Consul Enterprise Namespaces.
Example Usage
using Pulumi;
using Consul = Pulumi.Consul;
class MyStack : Stack
{
public MyStack()
{
var production = new Consul.Namespace("production", new Consul.NamespaceArgs
{
Description = "Production namespace",
Meta =
{
{ "foo", "bar" },
},
});
}
}
NamespaceArgs
NamespaceState
NetworkArea
NOTE: This feature requires Consul Enterprise.
The consul..NetworkArea resource manages a relationship between servers in two
different Consul datacenters.
Unlike Consul's WAN feature, network areas use just the server RPC port for communication, and relationships can be made between independent pairs of datacenters, so not all servers need to be fully connected. This allows for complex topologies among Consul datacenters like hub/spoke and more general trees.
Example Usage
using Pulumi;
using Consul = Pulumi.Consul;
class MyStack : Stack
{
public MyStack()
{
var dc2 = new Consul.NetworkArea("dc2", new Consul.NetworkAreaArgs
{
PeerDatacenter = "dc2",
RetryJoins =
{
"1.2.3.4",
},
UseTls = true,
});
}
}
NetworkAreaArgs
NetworkAreaState
Node
Provides access to Node data in Consul. This can be used to define a node. Currently, defining health checks is not supported.
Example Usage
using Pulumi;
using Consul = Pulumi.Consul;
class MyStack : Stack
{
public MyStack()
{
var foobar = new Consul.Node("foobar", new Consul.NodeArgs
{
Address = "192.168.10.10",
});
}
}
NodeArgs
NodeState
PreparedQuery
PreparedQueryArgs
PreparedQueryState
Provider
The provider type for the consul package. By default, resources use package-wide configuration
settings, however an explicit Provider instance may be created and passed during resource
construction to achieve fine-grained programmatic control over provider settings. See the
documentation for more information.
ProviderArgs
Service
A high-level resource for creating a Service in Consul in the Consul catalog. This is appropriate for registering external services and can be used to create services addressable by Consul that cannot be registered with a local agent.
If the Consul agent is running on the node where this service is registered, it is not recommended to use this resource.
Example Usage
using Pulumi;
using Consul = Pulumi.Consul;
class MyStack : Stack
{
public MyStack()
{
var compute = new Consul.Node("compute", new Consul.NodeArgs
{
Address = "www.google.com",
});
var google = new Consul.Service("google", new Consul.ServiceArgs
{
Node = compute.Name,
Port = 80,
Tags =
{
"tag0",
},
});
}
}