cloudenv

package
v0.0.0-...-3caaee0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2022 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Overview

Package cloudenv reports which known cloud environment we're running in.

Index

Constants

View Source
const (
	AWS   = Cloud("aws")   // Amazon Web Services (EC2 in particular)
	Azure = Cloud("azure") // Microsoft Azure
	GCP   = Cloud("gcp")   // Google Cloud
)
View Source
const AWSResolverIP = "169.254.169.253"

AWSResolverIP is the IP address of the AWS DNS server. See https://docs.aws.amazon.com/vpc/latest/userguide/vpc-dns.html

View Source
const AzureResolverIP = "168.63.129.16"

AzureResolverIP is Azure's DNS resolver IP. See https://docs.microsoft.com/en-us/azure/virtual-network/what-is-ip-address-168-63-129-16

View Source
const CommonNonRoutableMetadataIP = "169.254.169.254"

CommonNonRoutableMetadataIP is the IP address of the metadata server on Amazon EC2, Google Compute Engine, and Azure. It's not routable. (169.254.0.0/16 is a Link Local range: RFC 3927)

View Source
const GoogleMetadataAndDNSIP = "169.254.169.254"

GoogleMetadataAndDNSIP is the metadata IP used by Google Cloud. It's also the *.internal DNS server, and proxies to 8.8.8.8.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cloud

type Cloud string

Cloud is a recognize cloud environment with properties that Tailscale can specialize for in places.

func Get

func Get() Cloud

Get returns the current cloud, or the empty string if unknown.

func (Cloud) HasInternalTLD

func (c Cloud) HasInternalTLD() bool

HasInternalTLD reports whether c is a cloud environment whose ResolverIP serves *.internal records.

func (Cloud) ResolverIP

func (c Cloud) ResolverIP() string

ResolverIP returns the cloud host's recursive DNS server or the empty string if not available.

Jump to

Keyboard shortcuts

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