1. Packages
  2. Consul Provider
  3. API Docs
  4. ConfigEntry
Consul v3.12.4 published on Wednesday, Feb 12, 2025 by Pulumi

consul.ConfigEntry

Explore with Pulumi AI

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as consul from "@pulumi/consul";

const proxyDefaults = new consul.ConfigEntry("proxy_defaults", {
    kind: "proxy-defaults",
    name: "global",
    configJson: JSON.stringify({
        Config: {
            local_connect_timeout_ms: 1000,
            handshake_timeout_ms: 10000,
        },
    }),
});
const web = new consul.ConfigEntry("web", {
    name: "web",
    kind: "service-defaults",
    configJson: JSON.stringify({
        Protocol: "http",
    }),
});
const admin = new consul.ConfigEntry("admin", {
    name: "admin",
    kind: "service-defaults",
    configJson: JSON.stringify({
        Protocol: "http",
    }),
});
const serviceResolver = new consul.ConfigEntry("service_resolver", {
    kind: "service-resolver",
    name: web.name,
    configJson: JSON.stringify({
        DefaultSubset: "v1",
        Subsets: {
            v1: {
                Filter: "Service.Meta.version == v1",
            },
            v2: {
                Filter: "Service.Meta.version == v2",
            },
        },
    }),
});
const serviceSplitter = new consul.ConfigEntry("service_splitter", {
    kind: "service-splitter",
    name: serviceResolver.name,
    configJson: JSON.stringify({
        Splits: [
            {
                Weight: 90,
                ServiceSubset: "v1",
            },
            {
                Weight: 10,
                ServiceSubset: "v2",
            },
        ],
    }),
});
const serviceRouter = new consul.ConfigEntry("service_router", {
    kind: "service-router",
    name: "web",
    configJson: JSON.stringify({
        Routes: [{
            Match: {
                HTTP: {
                    PathPrefix: "/admin",
                },
            },
            Destination: {
                Service: "admin",
            },
        }],
    }),
});
const ingressGateway = new consul.ConfigEntry("ingress_gateway", {
    name: "us-east-ingress",
    kind: "ingress-gateway",
    configJson: JSON.stringify({
        TLS: {
            Enabled: true,
        },
        Listeners: [{
            Port: 8000,
            Protocol: "http",
            Services: [{
                Name: "*",
            }],
        }],
    }),
});
const terminatingGateway = new consul.ConfigEntry("terminating_gateway", {
    name: "us-west-gateway",
    kind: "terminating-gateway",
    configJson: JSON.stringify({
        Services: [{
            Name: "billing",
        }],
    }),
});
Copy
import pulumi
import json
import pulumi_consul as consul

proxy_defaults = consul.ConfigEntry("proxy_defaults",
    kind="proxy-defaults",
    name="global",
    config_json=json.dumps({
        "Config": {
            "local_connect_timeout_ms": 1000,
            "handshake_timeout_ms": 10000,
        },
    }))
web = consul.ConfigEntry("web",
    name="web",
    kind="service-defaults",
    config_json=json.dumps({
        "Protocol": "http",
    }))
admin = consul.ConfigEntry("admin",
    name="admin",
    kind="service-defaults",
    config_json=json.dumps({
        "Protocol": "http",
    }))
service_resolver = consul.ConfigEntry("service_resolver",
    kind="service-resolver",
    name=web.name,
    config_json=json.dumps({
        "DefaultSubset": "v1",
        "Subsets": {
            "v1": {
                "Filter": "Service.Meta.version == v1",
            },
            "v2": {
                "Filter": "Service.Meta.version == v2",
            },
        },
    }))
service_splitter = consul.ConfigEntry("service_splitter",
    kind="service-splitter",
    name=service_resolver.name,
    config_json=json.dumps({
        "Splits": [
            {
                "Weight": 90,
                "ServiceSubset": "v1",
            },
            {
                "Weight": 10,
                "ServiceSubset": "v2",
            },
        ],
    }))
service_router = consul.ConfigEntry("service_router",
    kind="service-router",
    name="web",
    config_json=json.dumps({
        "Routes": [{
            "Match": {
                "HTTP": {
                    "PathPrefix": "/admin",
                },
            },
            "Destination": {
                "Service": "admin",
            },
        }],
    }))
ingress_gateway = consul.ConfigEntry("ingress_gateway",
    name="us-east-ingress",
    kind="ingress-gateway",
    config_json=json.dumps({
        "TLS": {
            "Enabled": True,
        },
        "Listeners": [{
            "Port": 8000,
            "Protocol": "http",
            "Services": [{
                "Name": "*",
            }],
        }],
    }))
terminating_gateway = consul.ConfigEntry("terminating_gateway",
    name="us-west-gateway",
    kind="terminating-gateway",
    config_json=json.dumps({
        "Services": [{
            "Name": "billing",
        }],
    }))
Copy
package main

import (
	"encoding/json"

	"github.com/pulumi/pulumi-consul/sdk/v3/go/consul"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		tmpJSON0, err := json.Marshal(map[string]interface{}{
			"Config": map[string]interface{}{
				"local_connect_timeout_ms": 1000,
				"handshake_timeout_ms":     10000,
			},
		})
		if err != nil {
			return err
		}
		json0 := string(tmpJSON0)
		_, err = consul.NewConfigEntry(ctx, "proxy_defaults", &consul.ConfigEntryArgs{
			Kind:       pulumi.String("proxy-defaults"),
			Name:       pulumi.String("global"),
			ConfigJson: pulumi.String(json0),
		})
		if err != nil {
			return err
		}
		tmpJSON1, err := json.Marshal(map[string]interface{}{
			"Protocol": "http",
		})
		if err != nil {
			return err
		}
		json1 := string(tmpJSON1)
		web, err := consul.NewConfigEntry(ctx, "web", &consul.ConfigEntryArgs{
			Name:       pulumi.String("web"),
			Kind:       pulumi.String("service-defaults"),
			ConfigJson: pulumi.String(json1),
		})
		if err != nil {
			return err
		}
		tmpJSON2, err := json.Marshal(map[string]interface{}{
			"Protocol": "http",
		})
		if err != nil {
			return err
		}
		json2 := string(tmpJSON2)
		_, err = consul.NewConfigEntry(ctx, "admin", &consul.ConfigEntryArgs{
			Name:       pulumi.String("admin"),
			Kind:       pulumi.String("service-defaults"),
			ConfigJson: pulumi.String(json2),
		})
		if err != nil {
			return err
		}
		tmpJSON3, err := json.Marshal(map[string]interface{}{
			"DefaultSubset": "v1",
			"Subsets": map[string]interface{}{
				"v1": map[string]interface{}{
					"Filter": "Service.Meta.version == v1",
				},
				"v2": map[string]interface{}{
					"Filter": "Service.Meta.version == v2",
				},
			},
		})
		if err != nil {
			return err
		}
		json3 := string(tmpJSON3)
		serviceResolver, err := consul.NewConfigEntry(ctx, "service_resolver", &consul.ConfigEntryArgs{
			Kind:       pulumi.String("service-resolver"),
			Name:       web.Name,
			ConfigJson: pulumi.String(json3),
		})
		if err != nil {
			return err
		}
		tmpJSON4, err := json.Marshal(map[string]interface{}{
			"Splits": []interface{}{
				map[string]interface{}{
					"Weight":        90,
					"ServiceSubset": "v1",
				},
				map[string]interface{}{
					"Weight":        10,
					"ServiceSubset": "v2",
				},
			},
		})
		if err != nil {
			return err
		}
		json4 := string(tmpJSON4)
		_, err = consul.NewConfigEntry(ctx, "service_splitter", &consul.ConfigEntryArgs{
			Kind:       pulumi.String("service-splitter"),
			Name:       serviceResolver.Name,
			ConfigJson: pulumi.String(json4),
		})
		if err != nil {
			return err
		}
		tmpJSON5, err := json.Marshal(map[string]interface{}{
			"Routes": []map[string]interface{}{
				map[string]interface{}{
					"Match": map[string]interface{}{
						"HTTP": map[string]interface{}{
							"PathPrefix": "/admin",
						},
					},
					"Destination": map[string]interface{}{
						"Service": "admin",
					},
				},
			},
		})
		if err != nil {
			return err
		}
		json5 := string(tmpJSON5)
		_, err = consul.NewConfigEntry(ctx, "service_router", &consul.ConfigEntryArgs{
			Kind:       pulumi.String("service-router"),
			Name:       pulumi.String("web"),
			ConfigJson: pulumi.String(json5),
		})
		if err != nil {
			return err
		}
		tmpJSON6, err := json.Marshal(map[string]interface{}{
			"TLS": map[string]interface{}{
				"Enabled": true,
			},
			"Listeners": []map[string]interface{}{
				map[string]interface{}{
					"Port":     8000,
					"Protocol": "http",
					"Services": []map[string]interface{}{
						map[string]interface{}{
							"Name": "*",
						},
					},
				},
			},
		})
		if err != nil {
			return err
		}
		json6 := string(tmpJSON6)
		_, err = consul.NewConfigEntry(ctx, "ingress_gateway", &consul.ConfigEntryArgs{
			Name:       pulumi.String("us-east-ingress"),
			Kind:       pulumi.String("ingress-gateway"),
			ConfigJson: pulumi.String(json6),
		})
		if err != nil {
			return err
		}
		tmpJSON7, err := json.Marshal(map[string]interface{}{
			"Services": []map[string]interface{}{
				map[string]interface{}{
					"Name": "billing",
				},
			},
		})
		if err != nil {
			return err
		}
		json7 := string(tmpJSON7)
		_, err = consul.NewConfigEntry(ctx, "terminating_gateway", &consul.ConfigEntryArgs{
			Name:       pulumi.String("us-west-gateway"),
			Kind:       pulumi.String("terminating-gateway"),
			ConfigJson: pulumi.String(json7),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using Pulumi;
using Consul = Pulumi.Consul;

return await Deployment.RunAsync(() => 
{
    var proxyDefaults = new Consul.ConfigEntry("proxy_defaults", new()
    {
        Kind = "proxy-defaults",
        Name = "global",
        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()
    {
        Name = "web",
        Kind = "service-defaults",
        ConfigJson = JsonSerializer.Serialize(new Dictionary<string, object?>
        {
            ["Protocol"] = "http",
        }),
    });

    var admin = new Consul.ConfigEntry("admin", new()
    {
        Name = "admin",
        Kind = "service-defaults",
        ConfigJson = JsonSerializer.Serialize(new Dictionary<string, object?>
        {
            ["Protocol"] = "http",
        }),
    });

    var serviceResolver = new Consul.ConfigEntry("service_resolver", new()
    {
        Kind = "service-resolver",
        Name = web.Name,
        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("service_splitter", new()
    {
        Kind = "service-splitter",
        Name = serviceResolver.Name,
        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("service_router", new()
    {
        Kind = "service-router",
        Name = "web",
        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",
                    },
                },
            },
        }),
    });

    var ingressGateway = new Consul.ConfigEntry("ingress_gateway", new()
    {
        Name = "us-east-ingress",
        Kind = "ingress-gateway",
        ConfigJson = JsonSerializer.Serialize(new Dictionary<string, object?>
        {
            ["TLS"] = new Dictionary<string, object?>
            {
                ["Enabled"] = true,
            },
            ["Listeners"] = new[]
            {
                new Dictionary<string, object?>
                {
                    ["Port"] = 8000,
                    ["Protocol"] = "http",
                    ["Services"] = new[]
                    {
                        new Dictionary<string, object?>
                        {
                            ["Name"] = "*",
                        },
                    },
                },
            },
        }),
    });

    var terminatingGateway = new Consul.ConfigEntry("terminating_gateway", new()
    {
        Name = "us-west-gateway",
        Kind = "terminating-gateway",
        ConfigJson = JsonSerializer.Serialize(new Dictionary<string, object?>
        {
            ["Services"] = new[]
            {
                new Dictionary<string, object?>
                {
                    ["Name"] = "billing",
                },
            },
        }),
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.consul.ConfigEntry;
import com.pulumi.consul.ConfigEntryArgs;
import static com.pulumi.codegen.internal.Serialization.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var proxyDefaults = new ConfigEntry("proxyDefaults", ConfigEntryArgs.builder()
            .kind("proxy-defaults")
            .name("global")
            .configJson(serializeJson(
                jsonObject(
                    jsonProperty("Config", jsonObject(
                        jsonProperty("local_connect_timeout_ms", 1000),
                        jsonProperty("handshake_timeout_ms", 10000)
                    ))
                )))
            .build());

        var web = new ConfigEntry("web", ConfigEntryArgs.builder()
            .name("web")
            .kind("service-defaults")
            .configJson(serializeJson(
                jsonObject(
                    jsonProperty("Protocol", "http")
                )))
            .build());

        var admin = new ConfigEntry("admin", ConfigEntryArgs.builder()
            .name("admin")
            .kind("service-defaults")
            .configJson(serializeJson(
                jsonObject(
                    jsonProperty("Protocol", "http")
                )))
            .build());

        var serviceResolver = new ConfigEntry("serviceResolver", ConfigEntryArgs.builder()
            .kind("service-resolver")
            .name(web.name())
            .configJson(serializeJson(
                jsonObject(
                    jsonProperty("DefaultSubset", "v1"),
                    jsonProperty("Subsets", jsonObject(
                        jsonProperty("v1", jsonObject(
                            jsonProperty("Filter", "Service.Meta.version == v1")
                        )),
                        jsonProperty("v2", jsonObject(
                            jsonProperty("Filter", "Service.Meta.version == v2")
                        ))
                    ))
                )))
            .build());

        var serviceSplitter = new ConfigEntry("serviceSplitter", ConfigEntryArgs.builder()
            .kind("service-splitter")
            .name(serviceResolver.name())
            .configJson(serializeJson(
                jsonObject(
                    jsonProperty("Splits", jsonArray(
                        jsonObject(
                            jsonProperty("Weight", 90),
                            jsonProperty("ServiceSubset", "v1")
                        ), 
                        jsonObject(
                            jsonProperty("Weight", 10),
                            jsonProperty("ServiceSubset", "v2")
                        )
                    ))
                )))
            .build());

        var serviceRouter = new ConfigEntry("serviceRouter", ConfigEntryArgs.builder()
            .kind("service-router")
            .name("web")
            .configJson(serializeJson(
                jsonObject(
                    jsonProperty("Routes", jsonArray(jsonObject(
                        jsonProperty("Match", jsonObject(
                            jsonProperty("HTTP", jsonObject(
                                jsonProperty("PathPrefix", "/admin")
                            ))
                        )),
                        jsonProperty("Destination", jsonObject(
                            jsonProperty("Service", "admin")
                        ))
                    )))
                )))
            .build());

        var ingressGateway = new ConfigEntry("ingressGateway", ConfigEntryArgs.builder()
            .name("us-east-ingress")
            .kind("ingress-gateway")
            .configJson(serializeJson(
                jsonObject(
                    jsonProperty("TLS", jsonObject(
                        jsonProperty("Enabled", true)
                    )),
                    jsonProperty("Listeners", jsonArray(jsonObject(
                        jsonProperty("Port", 8000),
                        jsonProperty("Protocol", "http"),
                        jsonProperty("Services", jsonArray(jsonObject(
                            jsonProperty("Name", "*")
                        )))
                    )))
                )))
            .build());

        var terminatingGateway = new ConfigEntry("terminatingGateway", ConfigEntryArgs.builder()
            .name("us-west-gateway")
            .kind("terminating-gateway")
            .configJson(serializeJson(
                jsonObject(
                    jsonProperty("Services", jsonArray(jsonObject(
                        jsonProperty("Name", "billing")
                    )))
                )))
            .build());

    }
}
Copy
resources:
  proxyDefaults:
    type: consul:ConfigEntry
    name: proxy_defaults
    properties:
      kind: proxy-defaults
      name: global
      configJson:
        fn::toJSON:
          Config:
            local_connect_timeout_ms: 1000
            handshake_timeout_ms: 10000
  web:
    type: consul:ConfigEntry
    properties:
      name: web
      kind: service-defaults
      configJson:
        fn::toJSON:
          Protocol: http
  admin:
    type: consul:ConfigEntry
    properties:
      name: admin
      kind: service-defaults
      configJson:
        fn::toJSON:
          Protocol: http
  serviceResolver:
    type: consul:ConfigEntry
    name: service_resolver
    properties:
      kind: service-resolver
      name: ${web.name}
      configJson:
        fn::toJSON:
          DefaultSubset: v1
          Subsets:
            v1:
              Filter: Service.Meta.version == v1
            v2:
              Filter: Service.Meta.version == v2
  serviceSplitter:
    type: consul:ConfigEntry
    name: service_splitter
    properties:
      kind: service-splitter
      name: ${serviceResolver.name}
      configJson:
        fn::toJSON:
          Splits:
            - Weight: 90
              ServiceSubset: v1
            - Weight: 10
              ServiceSubset: v2
  serviceRouter:
    type: consul:ConfigEntry
    name: service_router
    properties:
      kind: service-router
      name: web
      configJson:
        fn::toJSON:
          Routes:
            - Match:
                HTTP:
                  PathPrefix: /admin
              Destination:
                Service: admin
  ingressGateway:
    type: consul:ConfigEntry
    name: ingress_gateway
    properties:
      name: us-east-ingress
      kind: ingress-gateway
      configJson:
        fn::toJSON:
          TLS:
            Enabled: true
          Listeners:
            - Port: 8000
              Protocol: http
              Services:
                - Name: '*'
  terminatingGateway:
    type: consul:ConfigEntry
    name: terminating_gateway
    properties:
      name: us-west-gateway
      kind: terminating-gateway
      configJson:
        fn::toJSON:
          Services:
            - Name: billing
Copy

service-intentions config entry

import * as pulumi from "@pulumi/pulumi";
import * as consul from "@pulumi/consul";

const serviceIntentions = new consul.ConfigEntry("service_intentions", {
    name: "api-service",
    kind: "service-intentions",
    configJson: JSON.stringify({
        Sources: [
            {
                Action: "allow",
                Name: "frontend-webapp",
                Precedence: 9,
                Type: "consul",
            },
            {
                Action: "allow",
                Name: "nightly-cronjob",
                Precedence: 9,
                Type: "consul",
            },
        ],
    }),
});
Copy
import pulumi
import json
import pulumi_consul as consul

service_intentions = consul.ConfigEntry("service_intentions",
    name="api-service",
    kind="service-intentions",
    config_json=json.dumps({
        "Sources": [
            {
                "Action": "allow",
                "Name": "frontend-webapp",
                "Precedence": 9,
                "Type": "consul",
            },
            {
                "Action": "allow",
                "Name": "nightly-cronjob",
                "Precedence": 9,
                "Type": "consul",
            },
        ],
    }))
Copy
package main

import (
	"encoding/json"

	"github.com/pulumi/pulumi-consul/sdk/v3/go/consul"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		tmpJSON0, err := json.Marshal(map[string]interface{}{
			"Sources": []map[string]interface{}{
				map[string]interface{}{
					"Action":     "allow",
					"Name":       "frontend-webapp",
					"Precedence": 9,
					"Type":       "consul",
				},
				map[string]interface{}{
					"Action":     "allow",
					"Name":       "nightly-cronjob",
					"Precedence": 9,
					"Type":       "consul",
				},
			},
		})
		if err != nil {
			return err
		}
		json0 := string(tmpJSON0)
		_, err = consul.NewConfigEntry(ctx, "service_intentions", &consul.ConfigEntryArgs{
			Name:       pulumi.String("api-service"),
			Kind:       pulumi.String("service-intentions"),
			ConfigJson: pulumi.String(json0),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using Pulumi;
using Consul = Pulumi.Consul;

return await Deployment.RunAsync(() => 
{
    var serviceIntentions = new Consul.ConfigEntry("service_intentions", new()
    {
        Name = "api-service",
        Kind = "service-intentions",
        ConfigJson = JsonSerializer.Serialize(new Dictionary<string, object?>
        {
            ["Sources"] = new[]
            {
                new Dictionary<string, object?>
                {
                    ["Action"] = "allow",
                    ["Name"] = "frontend-webapp",
                    ["Precedence"] = 9,
                    ["Type"] = "consul",
                },
                new Dictionary<string, object?>
                {
                    ["Action"] = "allow",
                    ["Name"] = "nightly-cronjob",
                    ["Precedence"] = 9,
                    ["Type"] = "consul",
                },
            },
        }),
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.consul.ConfigEntry;
import com.pulumi.consul.ConfigEntryArgs;
import static com.pulumi.codegen.internal.Serialization.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var serviceIntentions = new ConfigEntry("serviceIntentions", ConfigEntryArgs.builder()
            .name("api-service")
            .kind("service-intentions")
            .configJson(serializeJson(
                jsonObject(
                    jsonProperty("Sources", jsonArray(
                        jsonObject(
                            jsonProperty("Action", "allow"),
                            jsonProperty("Name", "frontend-webapp"),
                            jsonProperty("Precedence", 9),
                            jsonProperty("Type", "consul")
                        ), 
                        jsonObject(
                            jsonProperty("Action", "allow"),
                            jsonProperty("Name", "nightly-cronjob"),
                            jsonProperty("Precedence", 9),
                            jsonProperty("Type", "consul")
                        )
                    ))
                )))
            .build());

    }
}
Copy
resources:
  serviceIntentions:
    type: consul:ConfigEntry
    name: service_intentions
    properties:
      name: api-service
      kind: service-intentions
      configJson:
        fn::toJSON:
          Sources:
            - Action: allow
              Name: frontend-webapp
              Precedence: 9
              Type: consul
            - Action: allow
              Name: nightly-cronjob
              Precedence: 9
              Type: consul
Copy
import * as pulumi from "@pulumi/pulumi";
import * as consul from "@pulumi/consul";

const sd = new consul.ConfigEntry("sd", {
    name: "fort-knox",
    kind: "service-defaults",
    configJson: JSON.stringify({
        Protocol: "http",
    }),
});
const jwtProvider = new consul.ConfigEntry("jwt_provider", {
    name: "test-provider",
    kind: "jwt-provider",
    configJson: JSON.stringify({
        Issuer: "test-issuer",
        JSONWebKeySet: {
            Remote: {
                URI: "https://127.0.0.1:9091",
                FetchAsynchronously: true,
            },
        },
        Forwarding: {
            HeaderName: "test-token",
        },
    }),
});
const serviceIntentions = new consul.ConfigEntry("service_intentions", {
    name: sd.name,
    kind: "service-intentions",
    configJson: pulumi.jsonStringify({
        Sources: [
            {
                Name: "contractor-webapp",
                Permissions: [{
                    Action: "allow",
                    HTTP: {
                        Methods: [
                            "GET",
                            "HEAD",
                        ],
                        PathExact: "/healtz",
                    },
                    JWT: {
                        Providers: [{
                            Name: jwtProvider.name,
                        }],
                    },
                }],
                Precedence: 9,
                Type: "consul",
            },
            {
                Name: "admin-dashboard-webapp",
                Permissions: [
                    {
                        Action: "deny",
                        HTTP: {
                            PathPrefix: "/debugz",
                        },
                    },
                    {
                        Action: "allow",
                        HTTP: {
                            PathPrefix: "/",
                        },
                    },
                ],
                Precedence: 9,
                Type: "consul",
            },
        ],
    }),
});
Copy
import pulumi
import json
import pulumi_consul as consul

sd = consul.ConfigEntry("sd",
    name="fort-knox",
    kind="service-defaults",
    config_json=json.dumps({
        "Protocol": "http",
    }))
jwt_provider = consul.ConfigEntry("jwt_provider",
    name="test-provider",
    kind="jwt-provider",
    config_json=json.dumps({
        "Issuer": "test-issuer",
        "JSONWebKeySet": {
            "Remote": {
                "URI": "https://127.0.0.1:9091",
                "FetchAsynchronously": True,
            },
        },
        "Forwarding": {
            "HeaderName": "test-token",
        },
    }))
service_intentions = consul.ConfigEntry("service_intentions",
    name=sd.name,
    kind="service-intentions",
    config_json=pulumi.Output.json_dumps({
        "Sources": [
            {
                "Name": "contractor-webapp",
                "Permissions": [{
                    "Action": "allow",
                    "HTTP": {
                        "Methods": [
                            "GET",
                            "HEAD",
                        ],
                        "PathExact": "/healtz",
                    },
                    "JWT": {
                        "Providers": [{
                            "Name": jwt_provider.name,
                        }],
                    },
                }],
                "Precedence": 9,
                "Type": "consul",
            },
            {
                "Name": "admin-dashboard-webapp",
                "Permissions": [
                    {
                        "Action": "deny",
                        "HTTP": {
                            "PathPrefix": "/debugz",
                        },
                    },
                    {
                        "Action": "allow",
                        "HTTP": {
                            "PathPrefix": "/",
                        },
                    },
                ],
                "Precedence": 9,
                "Type": "consul",
            },
        ],
    }))
Copy
package main

import (
	"encoding/json"

	"github.com/pulumi/pulumi-consul/sdk/v3/go/consul"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		tmpJSON0, err := json.Marshal(map[string]interface{}{
			"Protocol": "http",
		})
		if err != nil {
			return err
		}
		json0 := string(tmpJSON0)
		sd, err := consul.NewConfigEntry(ctx, "sd", &consul.ConfigEntryArgs{
			Name:       pulumi.String("fort-knox"),
			Kind:       pulumi.String("service-defaults"),
			ConfigJson: pulumi.String(json0),
		})
		if err != nil {
			return err
		}
		tmpJSON1, err := json.Marshal(map[string]interface{}{
			"Issuer": "test-issuer",
			"JSONWebKeySet": map[string]interface{}{
				"Remote": map[string]interface{}{
					"URI":                 "https://127.0.0.1:9091",
					"FetchAsynchronously": true,
				},
			},
			"Forwarding": map[string]interface{}{
				"HeaderName": "test-token",
			},
		})
		if err != nil {
			return err
		}
		json1 := string(tmpJSON1)
		jwtProvider, err := consul.NewConfigEntry(ctx, "jwt_provider", &consul.ConfigEntryArgs{
			Name:       pulumi.String("test-provider"),
			Kind:       pulumi.String("jwt-provider"),
			ConfigJson: pulumi.String(json1),
		})
		if err != nil {
			return err
		}
		_, err = consul.NewConfigEntry(ctx, "service_intentions", &consul.ConfigEntryArgs{
			Name: sd.Name,
			Kind: pulumi.String("service-intentions"),
			ConfigJson: jwtProvider.Name.ApplyT(func(name string) (pulumi.String, error) {
				var _zero pulumi.String
				tmpJSON2, err := json.Marshal(map[string]interface{}{
					"Sources": []interface{}{
						map[string]interface{}{
							"Name": "contractor-webapp",
							"Permissions": []map[string]interface{}{
								map[string]interface{}{
									"Action": "allow",
									"HTTP": map[string]interface{}{
										"Methods": []string{
											"GET",
											"HEAD",
										},
										"PathExact": "/healtz",
									},
									"JWT": map[string]interface{}{
										"Providers": []map[string]interface{}{
											map[string]interface{}{
												"Name": name,
											},
										},
									},
								},
							},
							"Precedence": 9,
							"Type":       "consul",
						},
						map[string]interface{}{
							"Name": "admin-dashboard-webapp",
							"Permissions": []map[string]interface{}{
								map[string]interface{}{
									"Action": "deny",
									"HTTP": map[string]interface{}{
										"PathPrefix": "/debugz",
									},
								},
								map[string]interface{}{
									"Action": "allow",
									"HTTP": map[string]interface{}{
										"PathPrefix": "/",
									},
								},
							},
							"Precedence": 9,
							"Type":       "consul",
						},
					},
				})
				if err != nil {
					return _zero, err
				}
				json2 := string(tmpJSON2)
				return pulumi.String(json2), nil
			}).(pulumi.StringOutput),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using Pulumi;
using Consul = Pulumi.Consul;

return await Deployment.RunAsync(() => 
{
    var sd = new Consul.ConfigEntry("sd", new()
    {
        Name = "fort-knox",
        Kind = "service-defaults",
        ConfigJson = JsonSerializer.Serialize(new Dictionary<string, object?>
        {
            ["Protocol"] = "http",
        }),
    });

    var jwtProvider = new Consul.ConfigEntry("jwt_provider", new()
    {
        Name = "test-provider",
        Kind = "jwt-provider",
        ConfigJson = JsonSerializer.Serialize(new Dictionary<string, object?>
        {
            ["Issuer"] = "test-issuer",
            ["JSONWebKeySet"] = new Dictionary<string, object?>
            {
                ["Remote"] = new Dictionary<string, object?>
                {
                    ["URI"] = "https://127.0.0.1:9091",
                    ["FetchAsynchronously"] = true,
                },
            },
            ["Forwarding"] = new Dictionary<string, object?>
            {
                ["HeaderName"] = "test-token",
            },
        }),
    });

    var serviceIntentions = new Consul.ConfigEntry("service_intentions", new()
    {
        Name = sd.Name,
        Kind = "service-intentions",
        ConfigJson = Output.JsonSerialize(Output.Create(new Dictionary<string, object?>
        {
            ["Sources"] = new[]
            {
                new Dictionary<string, object?>
                {
                    ["Name"] = "contractor-webapp",
                    ["Permissions"] = new[]
                    {
                        new Dictionary<string, object?>
                        {
                            ["Action"] = "allow",
                            ["HTTP"] = new Dictionary<string, object?>
                            {
                                ["Methods"] = new[]
                                {
                                    "GET",
                                    "HEAD",
                                },
                                ["PathExact"] = "/healtz",
                            },
                            ["JWT"] = new Dictionary<string, object?>
                            {
                                ["Providers"] = new[]
                                {
                                    new Dictionary<string, object?>
                                    {
                                        ["Name"] = jwtProvider.Name,
                                    },
                                },
                            },
                        },
                    },
                    ["Precedence"] = 9,
                    ["Type"] = "consul",
                },
                new Dictionary<string, object?>
                {
                    ["Name"] = "admin-dashboard-webapp",
                    ["Permissions"] = new[]
                    {
                        new Dictionary<string, object?>
                        {
                            ["Action"] = "deny",
                            ["HTTP"] = new Dictionary<string, object?>
                            {
                                ["PathPrefix"] = "/debugz",
                            },
                        },
                        new Dictionary<string, object?>
                        {
                            ["Action"] = "allow",
                            ["HTTP"] = new Dictionary<string, object?>
                            {
                                ["PathPrefix"] = "/",
                            },
                        },
                    },
                    ["Precedence"] = 9,
                    ["Type"] = "consul",
                },
            },
        })),
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.consul.ConfigEntry;
import com.pulumi.consul.ConfigEntryArgs;
import static com.pulumi.codegen.internal.Serialization.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var sd = new ConfigEntry("sd", ConfigEntryArgs.builder()
            .name("fort-knox")
            .kind("service-defaults")
            .configJson(serializeJson(
                jsonObject(
                    jsonProperty("Protocol", "http")
                )))
            .build());

        var jwtProvider = new ConfigEntry("jwtProvider", ConfigEntryArgs.builder()
            .name("test-provider")
            .kind("jwt-provider")
            .configJson(serializeJson(
                jsonObject(
                    jsonProperty("Issuer", "test-issuer"),
                    jsonProperty("JSONWebKeySet", jsonObject(
                        jsonProperty("Remote", jsonObject(
                            jsonProperty("URI", "https://127.0.0.1:9091"),
                            jsonProperty("FetchAsynchronously", true)
                        ))
                    )),
                    jsonProperty("Forwarding", jsonObject(
                        jsonProperty("HeaderName", "test-token")
                    ))
                )))
            .build());

        var serviceIntentions = new ConfigEntry("serviceIntentions", ConfigEntryArgs.builder()
            .name(sd.name())
            .kind("service-intentions")
            .configJson(jwtProvider.name().applyValue(name -> serializeJson(
                jsonObject(
                    jsonProperty("Sources", jsonArray(
                        jsonObject(
                            jsonProperty("Name", "contractor-webapp"),
                            jsonProperty("Permissions", jsonArray(jsonObject(
                                jsonProperty("Action", "allow"),
                                jsonProperty("HTTP", jsonObject(
                                    jsonProperty("Methods", jsonArray(
                                        "GET", 
                                        "HEAD"
                                    )),
                                    jsonProperty("PathExact", "/healtz")
                                )),
                                jsonProperty("JWT", jsonObject(
                                    jsonProperty("Providers", jsonArray(jsonObject(
                                        jsonProperty("Name", name)
                                    )))
                                ))
                            ))),
                            jsonProperty("Precedence", 9),
                            jsonProperty("Type", "consul")
                        ), 
                        jsonObject(
                            jsonProperty("Name", "admin-dashboard-webapp"),
                            jsonProperty("Permissions", jsonArray(
                                jsonObject(
                                    jsonProperty("Action", "deny"),
                                    jsonProperty("HTTP", jsonObject(
                                        jsonProperty("PathPrefix", "/debugz")
                                    ))
                                ), 
                                jsonObject(
                                    jsonProperty("Action", "allow"),
                                    jsonProperty("HTTP", jsonObject(
                                        jsonProperty("PathPrefix", "/")
                                    ))
                                )
                            )),
                            jsonProperty("Precedence", 9),
                            jsonProperty("Type", "consul")
                        )
                    ))
                ))))
            .build());

    }
}
Copy
resources:
  sd:
    type: consul:ConfigEntry
    properties:
      name: fort-knox
      kind: service-defaults
      configJson:
        fn::toJSON:
          Protocol: http
  jwtProvider:
    type: consul:ConfigEntry
    name: jwt_provider
    properties:
      name: test-provider
      kind: jwt-provider
      configJson:
        fn::toJSON:
          Issuer: test-issuer
          JSONWebKeySet:
            Remote:
              URI: https://127.0.0.1:9091
              FetchAsynchronously: true
          Forwarding:
            HeaderName: test-token
  serviceIntentions:
    type: consul:ConfigEntry
    name: service_intentions
    properties:
      name: ${sd.name}
      kind: service-intentions
      configJson:
        fn::toJSON:
          Sources:
            - Name: contractor-webapp
              Permissions:
                - Action: allow
                  HTTP:
                    Methods:
                      - GET
                      - HEAD
                    PathExact: /healtz
                  JWT:
                    Providers:
                      - Name: ${jwtProvider.name}
              Precedence: 9
              Type: consul
            - Name: admin-dashboard-webapp
              Permissions:
                - Action: deny
                  HTTP:
                    PathPrefix: /debugz
                - Action: allow
                  HTTP:
                    PathPrefix: /
              Precedence: 9
              Type: consul
Copy

exported-services config entry

import * as pulumi from "@pulumi/pulumi";
import * as consul from "@pulumi/consul";

const exportedServices = new consul.ConfigEntry("exported_services", {
    name: "test",
    kind: "exported-services",
    configJson: JSON.stringify({
        Services: [{
            Name: "test",
            Namespace: "default",
            Consumers: [{
                Partition: "default",
            }],
        }],
    }),
});
Copy
import pulumi
import json
import pulumi_consul as consul

exported_services = consul.ConfigEntry("exported_services",
    name="test",
    kind="exported-services",
    config_json=json.dumps({
        "Services": [{
            "Name": "test",
            "Namespace": "default",
            "Consumers": [{
                "Partition": "default",
            }],
        }],
    }))
Copy
package main

import (
	"encoding/json"

	"github.com/pulumi/pulumi-consul/sdk/v3/go/consul"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		tmpJSON0, err := json.Marshal(map[string]interface{}{
			"Services": []map[string]interface{}{
				map[string]interface{}{
					"Name":      "test",
					"Namespace": "default",
					"Consumers": []map[string]interface{}{
						map[string]interface{}{
							"Partition": "default",
						},
					},
				},
			},
		})
		if err != nil {
			return err
		}
		json0 := string(tmpJSON0)
		_, err = consul.NewConfigEntry(ctx, "exported_services", &consul.ConfigEntryArgs{
			Name:       pulumi.String("test"),
			Kind:       pulumi.String("exported-services"),
			ConfigJson: pulumi.String(json0),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using Pulumi;
using Consul = Pulumi.Consul;

return await Deployment.RunAsync(() => 
{
    var exportedServices = new Consul.ConfigEntry("exported_services", new()
    {
        Name = "test",
        Kind = "exported-services",
        ConfigJson = JsonSerializer.Serialize(new Dictionary<string, object?>
        {
            ["Services"] = new[]
            {
                new Dictionary<string, object?>
                {
                    ["Name"] = "test",
                    ["Namespace"] = "default",
                    ["Consumers"] = new[]
                    {
                        new Dictionary<string, object?>
                        {
                            ["Partition"] = "default",
                        },
                    },
                },
            },
        }),
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.consul.ConfigEntry;
import com.pulumi.consul.ConfigEntryArgs;
import static com.pulumi.codegen.internal.Serialization.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var exportedServices = new ConfigEntry("exportedServices", ConfigEntryArgs.builder()
            .name("test")
            .kind("exported-services")
            .configJson(serializeJson(
                jsonObject(
                    jsonProperty("Services", jsonArray(jsonObject(
                        jsonProperty("Name", "test"),
                        jsonProperty("Namespace", "default"),
                        jsonProperty("Consumers", jsonArray(jsonObject(
                            jsonProperty("Partition", "default")
                        )))
                    )))
                )))
            .build());

    }
}
Copy
resources:
  exportedServices:
    type: consul:ConfigEntry
    name: exported_services
    properties:
      name: test
      kind: exported-services
      configJson:
        fn::toJSON:
          Services:
            - Name: test
              Namespace: default
              Consumers:
                - Partition: default
Copy

mesh config entry

import * as pulumi from "@pulumi/pulumi";
import * as consul from "@pulumi/consul";

const mesh = new consul.ConfigEntry("mesh", {
    name: "mesh",
    kind: "mesh",
    partition: "default",
    configJson: JSON.stringify({
        TransparentProxy: {
            MeshDestinationsOnly: true,
        },
    }),
});
Copy
import pulumi
import json
import pulumi_consul as consul

mesh = consul.ConfigEntry("mesh",
    name="mesh",
    kind="mesh",
    partition="default",
    config_json=json.dumps({
        "TransparentProxy": {
            "MeshDestinationsOnly": True,
        },
    }))
Copy
package main

import (
	"encoding/json"

	"github.com/pulumi/pulumi-consul/sdk/v3/go/consul"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		tmpJSON0, err := json.Marshal(map[string]interface{}{
			"TransparentProxy": map[string]interface{}{
				"MeshDestinationsOnly": true,
			},
		})
		if err != nil {
			return err
		}
		json0 := string(tmpJSON0)
		_, err = consul.NewConfigEntry(ctx, "mesh", &consul.ConfigEntryArgs{
			Name:       pulumi.String("mesh"),
			Kind:       pulumi.String("mesh"),
			Partition:  pulumi.String("default"),
			ConfigJson: pulumi.String(json0),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using Pulumi;
using Consul = Pulumi.Consul;

return await Deployment.RunAsync(() => 
{
    var mesh = new Consul.ConfigEntry("mesh", new()
    {
        Name = "mesh",
        Kind = "mesh",
        Partition = "default",
        ConfigJson = JsonSerializer.Serialize(new Dictionary<string, object?>
        {
            ["TransparentProxy"] = new Dictionary<string, object?>
            {
                ["MeshDestinationsOnly"] = true,
            },
        }),
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.consul.ConfigEntry;
import com.pulumi.consul.ConfigEntryArgs;
import static com.pulumi.codegen.internal.Serialization.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var mesh = new ConfigEntry("mesh", ConfigEntryArgs.builder()
            .name("mesh")
            .kind("mesh")
            .partition("default")
            .configJson(serializeJson(
                jsonObject(
                    jsonProperty("TransparentProxy", jsonObject(
                        jsonProperty("MeshDestinationsOnly", true)
                    ))
                )))
            .build());

    }
}
Copy
resources:
  mesh:
    type: consul:ConfigEntry
    properties:
      name: mesh
      kind: mesh
      partition: default
      configJson:
        fn::toJSON:
          TransparentProxy:
            MeshDestinationsOnly: true
Copy

jwt-provider config entry

import * as pulumi from "@pulumi/pulumi";
import * as consul from "@pulumi/consul";

const jwtProvider = new consul.ConfigEntry("jwt_provider", {
    name: "provider-name",
    kind: "jwt-provider",
    configJson: JSON.stringify({
        Issuer: "https://your.issuer.com",
        JSONWebKeySet: {
            Remote: {
                URI: "https://your-remote.jwks.com",
                FetchAsynchronously: true,
                CacheDuration: "10s",
            },
        },
        Forwarding: {
            HeaderName: "test-token",
        },
    }),
});
Copy
import pulumi
import json
import pulumi_consul as consul

jwt_provider = consul.ConfigEntry("jwt_provider",
    name="provider-name",
    kind="jwt-provider",
    config_json=json.dumps({
        "Issuer": "https://your.issuer.com",
        "JSONWebKeySet": {
            "Remote": {
                "URI": "https://your-remote.jwks.com",
                "FetchAsynchronously": True,
                "CacheDuration": "10s",
            },
        },
        "Forwarding": {
            "HeaderName": "test-token",
        },
    }))
Copy
package main

import (
	"encoding/json"

	"github.com/pulumi/pulumi-consul/sdk/v3/go/consul"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		tmpJSON0, err := json.Marshal(map[string]interface{}{
			"Issuer": "https://your.issuer.com",
			"JSONWebKeySet": map[string]interface{}{
				"Remote": map[string]interface{}{
					"URI":                 "https://your-remote.jwks.com",
					"FetchAsynchronously": true,
					"CacheDuration":       "10s",
				},
			},
			"Forwarding": map[string]interface{}{
				"HeaderName": "test-token",
			},
		})
		if err != nil {
			return err
		}
		json0 := string(tmpJSON0)
		_, err = consul.NewConfigEntry(ctx, "jwt_provider", &consul.ConfigEntryArgs{
			Name:       pulumi.String("provider-name"),
			Kind:       pulumi.String("jwt-provider"),
			ConfigJson: pulumi.String(json0),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using Pulumi;
using Consul = Pulumi.Consul;

return await Deployment.RunAsync(() => 
{
    var jwtProvider = new Consul.ConfigEntry("jwt_provider", new()
    {
        Name = "provider-name",
        Kind = "jwt-provider",
        ConfigJson = JsonSerializer.Serialize(new Dictionary<string, object?>
        {
            ["Issuer"] = "https://your.issuer.com",
            ["JSONWebKeySet"] = new Dictionary<string, object?>
            {
                ["Remote"] = new Dictionary<string, object?>
                {
                    ["URI"] = "https://your-remote.jwks.com",
                    ["FetchAsynchronously"] = true,
                    ["CacheDuration"] = "10s",
                },
            },
            ["Forwarding"] = new Dictionary<string, object?>
            {
                ["HeaderName"] = "test-token",
            },
        }),
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.consul.ConfigEntry;
import com.pulumi.consul.ConfigEntryArgs;
import static com.pulumi.codegen.internal.Serialization.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var jwtProvider = new ConfigEntry("jwtProvider", ConfigEntryArgs.builder()
            .name("provider-name")
            .kind("jwt-provider")
            .configJson(serializeJson(
                jsonObject(
                    jsonProperty("Issuer", "https://your.issuer.com"),
                    jsonProperty("JSONWebKeySet", jsonObject(
                        jsonProperty("Remote", jsonObject(
                            jsonProperty("URI", "https://your-remote.jwks.com"),
                            jsonProperty("FetchAsynchronously", true),
                            jsonProperty("CacheDuration", "10s")
                        ))
                    )),
                    jsonProperty("Forwarding", jsonObject(
                        jsonProperty("HeaderName", "test-token")
                    ))
                )))
            .build());

    }
}
Copy
resources:
  jwtProvider:
    type: consul:ConfigEntry
    name: jwt_provider
    properties:
      name: provider-name
      kind: jwt-provider
      configJson:
        fn::toJSON:
          Issuer: https://your.issuer.com
          JSONWebKeySet:
            Remote:
              URI: https://your-remote.jwks.com
              FetchAsynchronously: true
              CacheDuration: 10s
          Forwarding:
            HeaderName: test-token
Copy

Create ConfigEntry Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new ConfigEntry(name: string, args: ConfigEntryArgs, opts?: CustomResourceOptions);
@overload
def ConfigEntry(resource_name: str,
                args: ConfigEntryArgs,
                opts: Optional[ResourceOptions] = None)

@overload
def ConfigEntry(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                kind: Optional[str] = None,
                config_json: Optional[str] = None,
                name: Optional[str] = None,
                namespace: Optional[str] = None,
                partition: Optional[str] = None)
func NewConfigEntry(ctx *Context, name string, args ConfigEntryArgs, opts ...ResourceOption) (*ConfigEntry, error)
public ConfigEntry(string name, ConfigEntryArgs args, CustomResourceOptions? opts = null)
public ConfigEntry(String name, ConfigEntryArgs args)
public ConfigEntry(String name, ConfigEntryArgs args, CustomResourceOptions options)
type: consul:ConfigEntry
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. ConfigEntryArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. ConfigEntryArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. ConfigEntryArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. ConfigEntryArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. ConfigEntryArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var configEntryResource = new Consul.ConfigEntry("configEntryResource", new()
{
    Kind = "string",
    ConfigJson = "string",
    Name = "string",
    Namespace = "string",
    Partition = "string",
});
Copy
example, err := consul.NewConfigEntry(ctx, "configEntryResource", &consul.ConfigEntryArgs{
	Kind:       pulumi.String("string"),
	ConfigJson: pulumi.String("string"),
	Name:       pulumi.String("string"),
	Namespace:  pulumi.String("string"),
	Partition:  pulumi.String("string"),
})
Copy
var configEntryResource = new ConfigEntry("configEntryResource", ConfigEntryArgs.builder()
    .kind("string")
    .configJson("string")
    .name("string")
    .namespace("string")
    .partition("string")
    .build());
Copy
config_entry_resource = consul.ConfigEntry("configEntryResource",
    kind="string",
    config_json="string",
    name="string",
    namespace="string",
    partition="string")
Copy
const configEntryResource = new consul.ConfigEntry("configEntryResource", {
    kind: "string",
    configJson: "string",
    name: "string",
    namespace: "string",
    partition: "string",
});
Copy
type: consul:ConfigEntry
properties:
    configJson: string
    kind: string
    name: string
    namespace: string
    partition: string
Copy

ConfigEntry Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The ConfigEntry resource accepts the following input properties:

Kind
This property is required.
Changes to this property will trigger replacement.
string
The kind of configuration entry to register.
ConfigJson string
An arbitrary map of configuration values.
Name Changes to this property will trigger replacement. string
The name of the configuration entry being registered.
Namespace Changes to this property will trigger replacement. string
The namespace to create the config entry within.
Partition Changes to this property will trigger replacement. string
The partition the config entry is associated with.
Kind
This property is required.
Changes to this property will trigger replacement.
string
The kind of configuration entry to register.
ConfigJson string
An arbitrary map of configuration values.
Name Changes to this property will trigger replacement. string
The name of the configuration entry being registered.
Namespace Changes to this property will trigger replacement. string
The namespace to create the config entry within.
Partition Changes to this property will trigger replacement. string
The partition the config entry is associated with.
kind
This property is required.
Changes to this property will trigger replacement.
String
The kind of configuration entry to register.
configJson String
An arbitrary map of configuration values.
name Changes to this property will trigger replacement. String
The name of the configuration entry being registered.
namespace Changes to this property will trigger replacement. String
The namespace to create the config entry within.
partition Changes to this property will trigger replacement. String
The partition the config entry is associated with.
kind
This property is required.
Changes to this property will trigger replacement.
string
The kind of configuration entry to register.
configJson string
An arbitrary map of configuration values.
name Changes to this property will trigger replacement. string
The name of the configuration entry being registered.
namespace Changes to this property will trigger replacement. string
The namespace to create the config entry within.
partition Changes to this property will trigger replacement. string
The partition the config entry is associated with.
kind
This property is required.
Changes to this property will trigger replacement.
str
The kind of configuration entry to register.
config_json str
An arbitrary map of configuration values.
name Changes to this property will trigger replacement. str
The name of the configuration entry being registered.
namespace Changes to this property will trigger replacement. str
The namespace to create the config entry within.
partition Changes to this property will trigger replacement. str
The partition the config entry is associated with.
kind
This property is required.
Changes to this property will trigger replacement.
String
The kind of configuration entry to register.
configJson String
An arbitrary map of configuration values.
name Changes to this property will trigger replacement. String
The name of the configuration entry being registered.
namespace Changes to this property will trigger replacement. String
The namespace to create the config entry within.
partition Changes to this property will trigger replacement. String
The partition the config entry is associated with.

Outputs

All input properties are implicitly available as output properties. Additionally, the ConfigEntry resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing ConfigEntry Resource

Get an existing ConfigEntry 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?: ConfigEntryState, opts?: CustomResourceOptions): ConfigEntry
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        config_json: Optional[str] = None,
        kind: Optional[str] = None,
        name: Optional[str] = None,
        namespace: Optional[str] = None,
        partition: Optional[str] = None) -> ConfigEntry
func GetConfigEntry(ctx *Context, name string, id IDInput, state *ConfigEntryState, opts ...ResourceOption) (*ConfigEntry, error)
public static ConfigEntry Get(string name, Input<string> id, ConfigEntryState? state, CustomResourceOptions? opts = null)
public static ConfigEntry get(String name, Output<String> id, ConfigEntryState state, CustomResourceOptions options)
resources:  _:    type: consul:ConfigEntry    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
ConfigJson string
An arbitrary map of configuration values.
Kind Changes to this property will trigger replacement. string
The kind of configuration entry to register.
Name Changes to this property will trigger replacement. string
The name of the configuration entry being registered.
Namespace Changes to this property will trigger replacement. string
The namespace to create the config entry within.
Partition Changes to this property will trigger replacement. string
The partition the config entry is associated with.
ConfigJson string
An arbitrary map of configuration values.
Kind Changes to this property will trigger replacement. string
The kind of configuration entry to register.
Name Changes to this property will trigger replacement. string
The name of the configuration entry being registered.
Namespace Changes to this property will trigger replacement. string
The namespace to create the config entry within.
Partition Changes to this property will trigger replacement. string
The partition the config entry is associated with.
configJson String
An arbitrary map of configuration values.
kind Changes to this property will trigger replacement. String
The kind of configuration entry to register.
name Changes to this property will trigger replacement. String
The name of the configuration entry being registered.
namespace Changes to this property will trigger replacement. String
The namespace to create the config entry within.
partition Changes to this property will trigger replacement. String
The partition the config entry is associated with.
configJson string
An arbitrary map of configuration values.
kind Changes to this property will trigger replacement. string
The kind of configuration entry to register.
name Changes to this property will trigger replacement. string
The name of the configuration entry being registered.
namespace Changes to this property will trigger replacement. string
The namespace to create the config entry within.
partition Changes to this property will trigger replacement. string
The partition the config entry is associated with.
config_json str
An arbitrary map of configuration values.
kind Changes to this property will trigger replacement. str
The kind of configuration entry to register.
name Changes to this property will trigger replacement. str
The name of the configuration entry being registered.
namespace Changes to this property will trigger replacement. str
The namespace to create the config entry within.
partition Changes to this property will trigger replacement. str
The partition the config entry is associated with.
configJson String
An arbitrary map of configuration values.
kind Changes to this property will trigger replacement. String
The kind of configuration entry to register.
name Changes to this property will trigger replacement. String
The name of the configuration entry being registered.
namespace Changes to this property will trigger replacement. String
The namespace to create the config entry within.
partition Changes to this property will trigger replacement. String
The partition the config entry is associated with.

Import

consul_config_entry can be imported using the syntax <kind>/<name> if the config entry is in the default partition and default namespace, or <partition>/<namespace>/<kind>/<name> for config entries in a non-default partition or namespace:

$ pulumi import consul:index/configEntry:ConfigEntry service_splitter 816a195f-6cb1-2e8d-92af-3011ae706318
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
HashiCorp Consul pulumi/pulumi-consul
License
Apache-2.0
Notes
This Pulumi package is based on the consul Terraform Provider.