launchdarkly

package
v0.2.52 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 3, 2023 License: MPL-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BOOL_CLAUSE_VALUE   = "boolean"
	STRING_CLAUSE_VALUE = "string"
	NUMBER_CLAUSE_VALUE = "number"
)
View Source
const (
	APIVersion     = "20191212"
	MAX_RETRIES    = 8
	RETRY_WAIT_MIN = 200 * time.Millisecond
	RETRY_WAIT_MAX = 2000 * time.Millisecond
)
View Source
const (
	//gofmts:sort
	ACTIONS                          = "actions"
	API_KEY                          = "api_key"
	APPROVAL_SETTINGS                = "approval_settings"
	ARCHIVED                         = "archived"
	ATTRIBUTE                        = "attribute"
	BASE_PERMISSIONS                 = "base_permissions"
	BUCKET_BY                        = "bucket_by"
	CAN_APPLY_DECLINED_CHANGES       = "can_apply_declined_changes"
	CAN_REVIEW_OWN_REQUEST           = "can_review_own_request"
	CLAUSES                          = "clauses"
	CLIENT_SIDE_AVAILABILITY         = "client_side_availability"
	CLIENT_SIDE_ID                   = "client_side_id"
	COLOR                            = "color"
	CONFIG                           = "config"
	CONFIRM_CHANGES                  = "confirm_changes"
	CREATION_DATE                    = "creation_date"
	CUSTOM_PROPERTIES                = "custom_properties"
	CUSTOM_ROLES                     = "custom_roles"
	DEFAULTS                         = "defaults"
	DEFAULT_API_VERSION              = "default_api_version"
	DEFAULT_CLIENT_SIDE_AVAILABILITY = "default_client_side_availability"
	DEFAULT_OFF_VARIATION            = "default_off_variation"
	DEFAULT_ON_VARIATION             = "default_on_variation"
	DEFAULT_TRACK_EVENTS             = "default_track_events"
	DEFAULT_TTL                      = "default_ttl"
	DESCRIPTION                      = "description"
	DISPLAY_KEY                      = "display_key"
	EFFECT                           = "effect"
	EMAIL                            = "email"
	EMAILS                           = "emails"
	ENABLED                          = "enabled"
	ENVIRONMENTS                     = "environments"
	ENV_KEY                          = "env_key"
	EVENT_KEY                        = "event_key"
	EXCLUDED                         = "excluded"
	EXPIRE                           = "expire"
	FALLTHROUGH                      = "fallthrough"
	FIRST_NAME                       = "first_name"
	FLAG_ID                          = "flag_id"
	FLAG_KEY                         = "flag_key"
	FULL_KEY                         = "full_key"
	ID                               = "id"
	IGNORE_MISSING                   = "ignore_missing"
	INCLUDED                         = "included"
	INCLUDE_IN_SNIPPET               = "include_in_snippet"
	INLINE_ROLES                     = "inline_roles"
	INSTRUCTIONS                     = "instructions"
	INTEGRATION_KEY                  = "integration_key"
	IS_ACTIVE                        = "is_active"
	IS_NUMERIC                       = "is_numeric"
	KEY                              = "key"
	KIND                             = "kind"
	LAST_NAME                        = "last_name"
	MAINTAINER_ID                    = "maintainer_id"
	MIN_NUM_APPROVALS                = "min_num_approvals"
	MOBILE_KEY                       = "mobile_key"
	NAME                             = "name"
	NEGATE                           = "negate"
	NOT_ACTIONS                      = "not_actions"
	NOT_RESOURCES                    = "not_resources"
	OFF_VARIATION                    = "off_variation"
	ON                               = "on"
	ON_VARIATION                     = "on_variation"
	OP                               = "op"
	PATTERN                          = "pattern"
	POLICY                           = "policy"
	POLICY_STATEMENTS                = "policy_statements"
	PREREQUISITES                    = "prerequisites"
	PROJECT_KEY                      = "project_key"
	REQUIRED                         = "required"
	REQUIRED_APPROVAL_TAGS           = "required_approval_tags"
	REQUIRE_COMMENTS                 = "require_comments"
	RESOURCES                        = "resources"
	ROLE                             = "role"
	ROLLOUT_WEIGHTS                  = "rollout_weights"
	RULES                            = "rules"
	SECRET                           = "secret"
	SECURE_MODE                      = "secure_mode"
	SELECTOR                         = "selector"
	SERVICE_TOKEN                    = "service_token"
	STATEMENTS                       = "statements"
	SUBSTRING                        = "substring"
	SUCCESS_CRITERIA                 = "success_criteria"
	TAGS                             = "tags"
	TARGETS                          = "targets"
	TEAM_MEMBERS                     = "team_members"
	TEMPORARY                        = "temporary"
	TOKEN                            = "token"
	TRACK_EVENTS                     = "track_events"
	TRIGGER_URL                      = "trigger_url"
	UNIT                             = "unit"
	URL                              = "url"
	URLS                             = "urls"
	USING_ENVIRONMENT_ID             = "using_environment_id"
	USING_MOBILE_KEY                 = "using_mobile_key"
	VALUE                            = "value"
	VALUES                           = "values"
	VALUE_TYPE                       = "value_type"
	VARIATION                        = "variation"
	VARIATIONS                       = "variations"
	VARIATION_TYPE                   = "variation_type"
	WEIGHT                           = "weight"
)

keys used in terraform files referencing keys in launchdarkly resource objects. The name of each constant is the same as its value.

View Source
const (
	LAUNCHDARKLY_ACCESS_TOKEN = "LAUNCHDARKLY_ACCESS_TOKEN"
	LAUNCHDARKLY_API_HOST     = "LAUNCHDARKLY_API_HOST"
	LAUNCHDARKLY_OAUTH_TOKEN  = "LAUNCHDARKLY_OAUTH_TOKEN"
)

Environment Variables

View Source
const (
	BOOL_VARIATION   = "boolean"
	STRING_VARIATION = "string"
	NUMBER_VARIATION = "number"
	JSON_VARIATION   = "json"
)
View Source
const CUSTOM_PROPERTY_CHAR_LIMIT = 64

https://docs.launchdarkly.com/docs/custom-properties

View Source
const CUSTOM_PROPERTY_ITEM_LIMIT = 64

Variables

View Source
var (
	KINESIS_CONVERSION = map[string]interface{}{
		"region":      "region",
		"role_arn":    "roleArn",
		"stream_name": "streamName",
	}
	MPARTICLE_CONVERSION = map[string]interface{}{
		"api_key":       "apiKey",
		"secret":        "secret",
		"user_identity": "userIdentity",
		"environment":   "environment",
	}
	SEGMENT_CONVERSION = map[string]interface{}{
		"write_key": "writeKey",
	}
	GOOGLE_PUBSUB_CONVERSION = map[string]interface{}{
		"project": "project",
		"topic":   "topic",
	}
	AZURE_EVENT_HUBS_CONVERSION = map[string]interface{}{
		"namespace":   "namespace",
		"name":        "name",
		"policy_name": "policyName",
		"policy_key":  "policyKey",
	}
	CONFIG_CONVERSIONS = map[string]map[string]interface{}{
		"kinesis":          KINESIS_CONVERSION,
		"mparticle":        MPARTICLE_CONVERSION,
		"segment":          SEGMENT_CONVERSION,
		"google-pubsub":    GOOGLE_PUBSUB_CONVERSION,
		"azure-event-hubs": AZURE_EVENT_HUBS_CONVERSION,
	}
)
View Source
var EXTRA_SUBSCRIPTION_CONFIGURATION_FIELDS = map[string]IntegrationConfig{
	"slack": {
		"url": {
			Type:          "uri",
			IsOptional:    false,
			AllowedValues: []string{},
			DefaultValue:  nil,
			IsSecret:      false,
		},
	},
}

There is not currently a manifest for slack webhooks so we have to use this for now.

View Source
var KEBAB_CASE_INTEGRATIONS = []string{"splunk"}
View Source
var SUBSCRIPTION_CONFIGURATION_FIELDS = map[string]IntegrationConfig{
	"datadog": {
		"apiKey": {
			AllowedValues: []string{},
			DefaultValue:  nil,
			Description:   "Enter your Datadog [API key](https://app.datadoghq.com/organization-settings/api-keys).",
			IsOptional:    false,
			IsSecret:      true,
			Type:          "string",
		},
		"hideMemberDetails": {
			AllowedValues: []string{},
			DefaultValue:  false,
			Description:   "Don't send related member email and names.",
			IsOptional:    true,
			IsSecret:      false,
			Type:          "boolean",
		},
		"hostURL": {
			AllowedValues: []string{"https://api.datadoghq.com", "https://api.datadoghq.eu", "https://us3.datadoghq.com", "https://us5.datadoghq.com", "https://app.ddog-gov.com"},
			DefaultValue:  "https://api.datadoghq.com",
			Description:   "Your Datadog host URL. Read [How do I tell which Datadog site I am on?](https://docs.datadoghq.com/getting_started/site/#how-do-i-tell-which-datadog-site-i-am-on) if you are unsure which host URL to select.",
			IsOptional:    true,
			IsSecret:      false,
			Type:          "enum",
		},
	},
	"dynatrace": {
		"apiToken": {
			AllowedValues: []string{},
			DefaultValue:  nil,
			Description:   "Enter your Dynatrace API token. [Learn more](https://www.dynatrace.com/support/help/shortlink/api-authentication#generate-a-token) about generating tokens. The 'access problem and event feed, metrics, and topology' scope is required.",
			IsOptional:    false,
			IsSecret:      true,
			Type:          "string",
		},
		"entity": {
			AllowedValues: []string{"APPLICATION", "APPLICATION_METHOD", "APPLICATION_METHOD_GROUP", "AUTO_SCALING_GROUP", "AUXILIARY_SYNTHETIC_TEST", "AWS_APPLICATION_LOAD_BALANCER", "AWS_AVAILABILITY_ZONE", "AWS_CREDENTIALS", "AWS_LAMBDA_FUNCTION", "AWS_NETWORK_LOAD_BALANCER", "AZURE_API_MANAGEMENT_SERVICE", "AZURE_APPLICATION_GATEWAY", "AZURE_COSMOS_DB", "AZURE_CREDENTIALS", "AZURE_EVENT_HUB", "AZURE_EVENT_HUB_NAMESPACE", "AZURE_FUNCTION_APP", "AZURE_IOT_HUB", "AZURE_LOAD_BALANCER", "AZURE_MGMT_GROUP", "AZURE_REDIS_CACHE", "AZURE_REGION", "AZURE_SERVICE_BUS_NAMESPACE", "AZURE_SERVICE_BUS_QUEUE", "AZURE_SERVICE_BUS_TOPIC", "AZURE_SQL_DATABASE", "AZURE_SQL_ELASTIC_POOL", "AZURE_SQL_SERVER", "AZURE_STORAGE_ACCOUNT", "AZURE_SUBSCRIPTION", "AZURE_TENANT", "AZURE_VM", "AZURE_VM_SCALE_SET", "AZURE_WEB_APP", "CF_APPLICATION", "CF_FOUNDATION", "CINDER_VOLUME", "CLOUD_APPLICATION", "CLOUD_APPLICATION_INSTANCE", "CLOUD_APPLICATION_NAMESPACE", "CONTAINER_GROUP", "CONTAINER_GROUP_INSTANCE", "CUSTOM_APPLICATION", "CUSTOM_DEVICE", "CUSTOM_DEVICE_GROUP", "DCRUM_APPLICATION", "DCRUM_SERVICE", "DCRUM_SERVICE_INSTANCE", "DEVICE_APPLICATION_METHOD", "DISK", "DOCKER_CONTAINER_GROUP_INSTANCE", "DYNAMO_DB_TABLE", "EBS_VOLUME", "EC2_INSTANCE", "ELASTIC_LOAD_BALANCER", "ENVIRONMENT", "EXTERNAL_SYNTHETIC_TEST_STEP", "GCP_ZONE", "GEOLOCATION", "GEOLOC_SITE", "GOOGLE_COMPUTE_ENGINE", "HOST", "HOST_GROUP", "HTTP_CHECK", "HTTP_CHECK_STEP", "HYPERVISOR", "KUBERNETES_CLUSTER", "KUBERNETES_NODE", "MOBILE_APPLICATION", "NETWORK_INTERFACE", "NEUTRON_SUBNET", "OPENSTACK_PROJECT", "OPENSTACK_REGION", "OPENSTACK_VM", "OS", "PROCESS_GROUP", "PROCESS_GROUP_INSTANCE", "RELATIONAL_DATABASE_SERVICE", "SERVICE", "SERVICE_INSTANCE", "SERVICE_METHOD", "SERVICE_METHOD_GROUP", "SWIFT_CONTAINER", "SYNTHETIC_LOCATION", "SYNTHETIC_TEST", "SYNTHETIC_TEST_STEP", "VIRTUALMACHINE", "VMWARE_DATACENTER"},
			DefaultValue:  "APPLICATION",
			Description:   "Select the Dynatrace entity `meType` to associate with all events.",
			IsOptional:    true,
			IsSecret:      false,
			Type:          "enum",
		},
		"url": {
			AllowedValues: []string{},
			DefaultValue:  nil,
			Description:   "Enter the URL used to access your Dynatrace (managed or hosted) service. Follow the pattern shown in the placeholder text.",
			IsOptional:    false,
			IsSecret:      false,
			Type:          "uri",
		},
	},
	"elastic": {
		"index": {
			AllowedValues: []string{},
			DefaultValue:  nil,
			Description:   "Enter the index name where you want to store your LaunchDarkly data",
			IsOptional:    false,
			IsSecret:      false,
			Type:          "string",
		},
		"token": {
			AllowedValues: []string{},
			DefaultValue:  nil,
			Description:   "Enter the [base64 _credentials_ based on your API Key](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html)",
			IsOptional:    false,
			IsSecret:      true,
			Type:          "string",
		},
		"url": {
			AllowedValues: []string{},
			DefaultValue:  nil,
			Description:   "Enter the URL for your Elasticsearch endpoint including socket",
			IsOptional:    false,
			IsSecret:      false,
			Type:          "uri",
		},
	},
	"honeycomb": {
		"apiKey": {
			AllowedValues: []string{},
			DefaultValue:  nil,
			Description:   "Enter your [Honeycomb API key](https://ui.honeycomb.io/teams).",
			IsOptional:    false,
			IsSecret:      true,
			Type:          "string",
		},
		"datasetName": {
			AllowedValues: []string{},
			DefaultValue:  nil,
			Description:   "Enter the name of your Honeycomb dataset. This value will associate LaunchDarkly data with the corresponding Honeycomb dataset.",
			IsOptional:    false,
			IsSecret:      false,
			Type:          "string",
		},
	},
	"logdna": {
		"ingestionKey": {
			AllowedValues: []string{},
			DefaultValue:  nil,
			Description:   "Enter your [LogDNA ingestion key](https://app.logdna.com/manage/api-keys).",
			IsOptional:    false,
			IsSecret:      true,
			Type:          "string",
		},
		"level": {
			AllowedValues: []string{},
			DefaultValue:  "INFO",
			Description:   "The log level with which LaunchDarkly messages will be published.",
			IsOptional:    true,
			IsSecret:      false,
			Type:          "string",
		},
	},
	"msteams": {"url": {
		AllowedValues: []string{},
		DefaultValue:  nil,
		Description:   "Enter your Microsoft Teams [incoming webhook URL](https://docs.launchdarkly.com/integrations/microsoft-teams#setting-up-a-connector-in-microsoft-teams).",
		IsOptional:    false,
		IsSecret:      false,
		Type:          "uri",
	}},
	"new-relic-apm": {
		"apiKey": {
			AllowedValues: []string{},
			DefaultValue:  nil,
			Description:   "Enter your [New Relic REST API key](https://docs.newrelic.com/docs/apis/get-started/intro-apis/types-new-relic-api-keys#rest-api-key).",
			IsOptional:    false,
			IsSecret:      true,
			Type:          "string",
		},
		"applicationId": {
			AllowedValues: []string{},
			DefaultValue:  nil,
			Description:   "Enter your [New Relic application ID](https://docs.newrelic.com/docs/accounts/install-new-relic/account-setup/app-id-other-product-ids#ui).",
			IsOptional:    false,
			IsSecret:      false,
			Type:          "string",
		},
		"domain": {
			AllowedValues: []string{"api.newrelic.com", "api.eu.newrelic.com"},
			DefaultValue:  "api.newrelic.com",
			Description:   "Your New Relic data center. The default(US) is \"api.newrelic.com\". Use \"api.eu.newrelic.com\" if you are using the EU data center.",
			IsOptional:    true,
			IsSecret:      false,
			Type:          "enum",
		},
	},
	"signalfx": {
		"accessToken": {
			AllowedValues: []string{},
			DefaultValue:  nil,
			Description:   "Enter your [SignalFx access token](https://docs.signalfx.com/en/latest/admin-guide/tokens.html#working-with-access-tokens).",
			IsOptional:    false,
			IsSecret:      true,
			Type:          "string",
		},
		"realm": {
			AllowedValues: []string{},
			DefaultValue:  nil,
			Description:   "Enter your [SignalFx realm](https://developers.signalfx.com/#realms-in-endpoints).",
			IsOptional:    false,
			IsSecret:      false,
			Type:          "string",
		},
	},
	"splunk": {
		"base-url": {
			AllowedValues: []string{},
			DefaultValue:  nil,
			Description:   "Enter your [Splunk HTTP event collector base URL](https://docs.splunk.com/Documentation/Splunk/latest/Data/UsetheHTTPEventCollector).",
			IsOptional:    false,
			IsSecret:      false,
			Type:          "string",
		},
		"skip-ca-verification": {
			AllowedValues: []string{},
			DefaultValue:  nil,
			Description:   "Splunk Cloud instances sign their own SSL certificates by default. If you use Splunk Cloud, you may need to skip certificate validation in order for this integration to work.",
			IsOptional:    false,
			IsSecret:      false,
			Type:          "boolean",
		},
		"token": {
			AllowedValues: []string{},
			DefaultValue:  nil,
			Description:   "Enter your HTTP event collector token value.",
			IsOptional:    false,
			IsSecret:      true,
			Type:          "string",
		},
	},
}

Functions

func Provider

func Provider() *schema.Provider

Provider returns a *schema.Provider.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is used by the provider to access the ld API.

type FormVariable

type FormVariable struct {
	Type          string
	IsOptional    bool
	AllowedValues []string
	DefaultValue  interface{}
	Description   string
	IsSecret      bool
}

type IntegrationConfig

type IntegrationConfig map[string]FormVariable

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL