tfawsresource

package
v0.0.0-...-4f69453 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2020 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TestCheckTypeSetElemAttr

func TestCheckTypeSetElemAttr(name, attr, value string) resource.TestCheckFunc

TestCheckTypeSetElemAttr is a resource.TestCheckFunc that accepts a resource name, an attribute path, which should use the sentinel value '*' for indexing into a TypeSet. The function verifies that an element matches the provided value.

Use this function over SDK provided TestCheckFunctions when validating a TypeSet where its elements are a simple value

func TestCheckTypeSetElemAttrPair

func TestCheckTypeSetElemAttrPair(nameFirst, keyFirst, nameSecond, keySecond string) resource.TestCheckFunc

TestCheckTypeSetElemAttrPair is a TestCheckFunc that verifies a pair of name/key combinations are equal where the first uses the sentinel value to index into a TypeSet.

E.g., tfawsresource.TestCheckTypeSetElemAttrPair("aws_autoscaling_group.bar", "availability_zones.*", "data.aws_availability_zones.available", "names.0") E.g., tfawsresource.TestCheckTypeSetElemAttrPair("aws_spot_fleet_request.bar", "launch_specification.*.instance_type", "data.data.aws_ec2_instance_type_offering.available", "instance_type")

func TestCheckTypeSetElemNestedAttrs

func TestCheckTypeSetElemNestedAttrs(name, attr string, values map[string]string) resource.TestCheckFunc

TestCheckTypeSetElemNestedAttrs is a resource.TestCheckFunc that accepts a resource name, an attribute path, which should use the sentinel value '*' for indexing into a TypeSet. The function verifies that an element matches the whole value map.

You may check for unset keys, however this will also match keys set to empty string. Please provide a map with at least 1 non-empty value.

  map[string]string{
	     "key1": "value",
      "key2": "",
  }

Use this function over SDK provided TestCheckFunctions when validating a TypeSet where its elements are a nested object with their own attrs/values.

Please note, if the provided value map is not granular enough, there exists the possibility you match an element you were not intending to, in the TypeSet. Provide a full mapping of attributes to be sure the unique element exists.

func TestMatchTypeSetElemNestedAttrs

func TestMatchTypeSetElemNestedAttrs(name, attr string, values map[string]*regexp.Regexp) resource.TestCheckFunc

TestMatchTypeSetElemNestedAttrs is a resource.TestCheckFunc similar to TestCheckTypeSetElemNestedAttrs with the exception that it verifies that an element matches a *regexp.Regexp.

You may check for unset keys, however this will also match keys set to empty string. Please provide a map with at least 1 non-empty value e.g.

  map[string]*regexp.Regexp{
	     "key1": regexp.MustCompile("value"),
      "key2": regexp.MustCompile(""),
  }

Types

This section is empty.

Jump to

Keyboard shortcuts

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