Skip to content

Commit

Permalink
adding changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
lewinkedrs committed Aug 3, 2022
1 parent 8b97205 commit ea3f934
Show file tree
Hide file tree
Showing 47 changed files with 139 additions and 119 deletions.
3 changes: 3 additions & 0 deletions .changelog/26120.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:new-data-source
aws_amp_workspace
```
7 changes: 4 additions & 3 deletions internal/acctest/acctest.go
Original file line number Diff line number Diff line change
Expand Up @@ -1649,9 +1649,10 @@ data "aws_availability_zones" "available" {
// AvailableEC2InstanceTypeForAvailabilityZone returns the configuration for a data source that describes
// the first available EC2 instance type offering in the specified availability zone from a list of preferred instance types.
// The first argument is either an Availability Zone name or Terraform configuration reference to one, e.g.
// * data.aws_availability_zones.available.names[0]
// * aws_subnet.test.availability_zone
// * us-west-2a
// - data.aws_availability_zones.available.names[0]
// - aws_subnet.test.availability_zone
// - us-west-2a
//
// The data source is named 'available'.
func AvailableEC2InstanceTypeForAvailabilityZone(availabilityZoneName string, preferredInstanceTypes ...string) string {
if !strings.Contains(availabilityZoneName, ".") {
Expand Down
3 changes: 1 addition & 2 deletions internal/create/naming.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ func hasResourceUniqueIDPlusAdditionalSuffix(s string, additionalSuffix string)
//
// An expected usage might be:
//
// d.Set("name_prefix", create.NamePrefixFromName(d.Id()))
//
// d.Set("name_prefix", create.NamePrefixFromName(d.Id()))
func NamePrefixFromName(name string) *string {
return NamePrefixFromNameWithSuffix(name, "")
}
Expand Down
4 changes: 2 additions & 2 deletions internal/service/acm/certificate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ func TestAccACMCertificate_disableCTLogging(t *testing.T) {
})
}

//lintignore:AT002
// lintignore:AT002
func TestAccACMCertificate_Imported_domainName(t *testing.T) {
resourceName := "aws_acm_certificate.test"
commonName := "example.com"
Expand Down Expand Up @@ -654,7 +654,7 @@ func TestAccACMCertificate_Imported_domainName(t *testing.T) {
})
}

//lintignore:AT002
// lintignore:AT002
func TestAccACMCertificate_Imported_ipAddress(t *testing.T) { // Reference: https://github.com/hashicorp/terraform-provider-aws/issues/7103
resourceName := "aws_acm_certificate.test"
var v acm.CertificateDetail
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ data "aws_acmpca_certificate_authority" "test" {
`, commonName)
}

//lintignore:AWSAT003,AWSAT005
// lintignore:AWSAT003,AWSAT005
const testAccCertificateAuthorityDataSourceConfig_nonExistent = `
data "aws_acmpca_certificate_authority" "test" {
arn = "arn:aws:acm-pca:us-east-1:123456789012:certificate-authority/tf-acc-test-does-not-exist"
Expand Down
8 changes: 4 additions & 4 deletions internal/service/appstream/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/hashicorp/terraform-provider-aws/internal/tfresource"
)

//statusStackState fetches the fleet and its state
// statusStackState fetches the fleet and its state
func statusStackState(ctx context.Context, conn *appstream.AppStream, name string) resource.StateRefreshFunc {
return func() (interface{}, string, error) {
stack, err := FindStackByName(ctx, conn, name)
Expand All @@ -25,7 +25,7 @@ func statusStackState(ctx context.Context, conn *appstream.AppStream, name strin
}
}

//statusFleetState fetches the fleet and its state
// statusFleetState fetches the fleet and its state
func statusFleetState(ctx context.Context, conn *appstream.AppStream, name string) resource.StateRefreshFunc {
return func() (interface{}, string, error) {
fleet, err := FindFleetByName(ctx, conn, name)
Expand All @@ -42,7 +42,7 @@ func statusFleetState(ctx context.Context, conn *appstream.AppStream, name strin
}
}

//statusImageBuilderState fetches the ImageBuilder and its state
// statusImageBuilderState fetches the ImageBuilder and its state
func statusImageBuilderState(ctx context.Context, conn *appstream.AppStream, name string) resource.StateRefreshFunc {
return func() (interface{}, string, error) {
imageBuilder, err := FindImageBuilderByName(ctx, conn, name)
Expand All @@ -59,7 +59,7 @@ func statusImageBuilderState(ctx context.Context, conn *appstream.AppStream, nam
}
}

//statusUserAvailable fetches the user available
// statusUserAvailable fetches the user available
func statusUserAvailable(ctx context.Context, conn *appstream.AppStream, username, authType string) resource.StateRefreshFunc {
return func() (interface{}, string, error) {
user, err := FindUserByUserNameAndAuthType(ctx, conn, username, authType)
Expand Down
6 changes: 3 additions & 3 deletions internal/service/cloudformation/stack_set_instance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,9 @@ func TestAccCloudFormationStackSetInstance_parameterOverrides(t *testing.T) {

// TestAccCloudFormationStackSetInstance_retainStack verifies retain_stack = true
// This acceptance test performs the following steps:
// * Trigger a Terraform destroy of the resource, which should only remove the instance from the StackSet
// * Check it still exists outside Terraform
// * Destroy for real outside Terraform
// - Trigger a Terraform destroy of the resource, which should only remove the instance from the StackSet
// - Check it still exists outside Terraform
// - Destroy for real outside Terraform
func TestAccCloudFormationStackSetInstance_retainStack(t *testing.T) {
var stack1 cloudformation.Stack
var stackInstance1, stackInstance2, stackInstance3 cloudformation.StackInstance
Expand Down
6 changes: 3 additions & 3 deletions internal/service/cloudfront/distribution_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1025,9 +1025,9 @@ func TestAccCloudFrontDistribution_enabled(t *testing.T) {

// TestAccCloudFrontDistribution_retainOnDelete verifies retain_on_delete = true
// This acceptance test performs the following steps:
// * Trigger a Terraform destroy of the resource, which should only disable the distribution
// * Check it still exists and is disabled outside Terraform
// * Destroy for real outside Terraform
// - Trigger a Terraform destroy of the resource, which should only disable the distribution
// - Check it still exists and is disabled outside Terraform
// - Destroy for real outside Terraform
func TestAccCloudFrontDistribution_retainOnDelete(t *testing.T) {
if testing.Short() {
t.Skip("skipping long-running test in short mode")
Expand Down
2 changes: 1 addition & 1 deletion internal/service/connect/bot_association_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"github.com/hashicorp/terraform-provider-aws/internal/tfresource"
)

//Serialized acceptance tests due to Connect account limits (max 2 parallel tests)
// Serialized acceptance tests due to Connect account limits (max 2 parallel tests)
func TestAccConnectBotAssociation_serial(t *testing.T) {
testCases := map[string]func(t *testing.T){
"basic": testAccBotAssociation_basic,
Expand Down
2 changes: 1 addition & 1 deletion internal/service/connect/contact_flow_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
tfconnect "github.com/hashicorp/terraform-provider-aws/internal/service/connect"
)

//Serialized acceptance tests due to Connect account limits (max 2 parallel tests)
// Serialized acceptance tests due to Connect account limits (max 2 parallel tests)
func TestAccConnectContactFlow_serial(t *testing.T) {
testCases := map[string]func(t *testing.T){
"basic": testAccContactFlow_basic,
Expand Down
2 changes: 1 addition & 1 deletion internal/service/connect/hours_of_operation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
tfconnect "github.com/hashicorp/terraform-provider-aws/internal/service/connect"
)

//Serialized acceptance tests due to Connect account limits (max 2 parallel tests)
// Serialized acceptance tests due to Connect account limits (max 2 parallel tests)
func TestAccConnectHoursOfOperation_serial(t *testing.T) {
testCases := map[string]func(t *testing.T){
"basic": testAccHoursOfOperation_basic,
Expand Down
2 changes: 1 addition & 1 deletion internal/service/connect/instance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"github.com/hashicorp/terraform-provider-aws/internal/conns"
)

//Serialized acceptance tests due to Connect account limits (max 2 parallel tests)
// Serialized acceptance tests due to Connect account limits (max 2 parallel tests)
func TestAccConnectInstance_serial(t *testing.T) {
testCases := map[string]func(t *testing.T){
"basic": testAccInstance_basic,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
tfconnect "github.com/hashicorp/terraform-provider-aws/internal/service/connect"
)

//Serialized acceptance tests due to Connect account limits (max 2 parallel tests)
// Serialized acceptance tests due to Connect account limits (max 2 parallel tests)
func TestAccConnectLambdaFunctionAssociation_serial(t *testing.T) {
testCases := map[string]func(t *testing.T){
"basic": testAccLambdaFunctionAssociation_basic,
Expand Down
2 changes: 1 addition & 1 deletion internal/service/connect/quick_connect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
tfconnect "github.com/hashicorp/terraform-provider-aws/internal/service/connect"
)

//Serialized acceptance tests due to Connect account limits (max 2 parallel tests)
// Serialized acceptance tests due to Connect account limits (max 2 parallel tests)
func TestAccConnectQuickConnect_serial(t *testing.T) {
testCases := map[string]func(t *testing.T){
"basic": testAccQuickConnect_phoneNumber,
Expand Down
2 changes: 1 addition & 1 deletion internal/service/connect/security_profile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
tfconnect "github.com/hashicorp/terraform-provider-aws/internal/service/connect"
)

//Serialized acceptance tests due to Connect account limits (max 2 parallel tests)
// Serialized acceptance tests due to Connect account limits (max 2 parallel tests)
func TestAccConnectSecurityProfile_serial(t *testing.T) {
testCases := map[string]func(t *testing.T){
"basic": testAccSecurityProfile_basic,
Expand Down
2 changes: 1 addition & 1 deletion internal/service/connect/user_hierarchy_group_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
tfconnect "github.com/hashicorp/terraform-provider-aws/internal/service/connect"
)

//Serialized acceptance tests due to Connect account limits (max 2 parallel tests)
// Serialized acceptance tests due to Connect account limits (max 2 parallel tests)
func TestAccConnectUserHierarchyGroup_serial(t *testing.T) {
testCases := map[string]func(t *testing.T){
"basic": testAccUserHierarchyGroup_basic,
Expand Down
2 changes: 1 addition & 1 deletion internal/service/connect/user_hierarchy_structure_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
tfconnect "github.com/hashicorp/terraform-provider-aws/internal/service/connect"
)

//Serialized acceptance tests due to Connect account limits (max 2 parallel tests)
// Serialized acceptance tests due to Connect account limits (max 2 parallel tests)
func TestAccConnectUserHierarchyStructure_serial(t *testing.T) {
testCases := map[string]func(t *testing.T){
"basic": testAccUserHierarchyStructure_basic,
Expand Down
2 changes: 1 addition & 1 deletion internal/service/connect/vocabulary_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
tfconnect "github.com/hashicorp/terraform-provider-aws/internal/service/connect"
)

//Serialized acceptance tests due to Connect account limits (max 2 parallel tests)
// Serialized acceptance tests due to Connect account limits (max 2 parallel tests)
func TestAccConnectVocabulary_serial(t *testing.T) {
testCases := map[string]func(t *testing.T){
"basic": testAccVocabulary_basic,
Expand Down
4 changes: 2 additions & 2 deletions internal/service/docdb/cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -368,8 +368,8 @@ func TestAccDocDBCluster_takeFinalSnapshot(t *testing.T) {
})
}

/// This is a regression test to make sure that we always cover the scenario as hightlighted in
/// https://github.com/hashicorp/terraform/issues/11568
// / This is a regression test to make sure that we always cover the scenario as hightlighted in
// / https://github.com/hashicorp/terraform/issues/11568
func TestAccDocDBCluster_missingUserNameCausesError(t *testing.T) {
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acctest.PreCheck(t) },
Expand Down
2 changes: 1 addition & 1 deletion internal/service/ec2/ec2_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -2918,7 +2918,7 @@ func expandEnclaveOptions(l []interface{}) *ec2.EnclaveOptionsRequest {
return opts
}

//Expands an array of secondary Private IPs into a ec2 Private IP Address Spec
// Expands an array of secondary Private IPs into a ec2 Private IP Address Spec
func expandSecondaryPrivateIPAddresses(ips []interface{}) []*ec2.PrivateIpAddressSpecification {
specs := make([]*ec2.PrivateIpAddressSpecification, 0, len(ips))
for _, v := range ips {
Expand Down
18 changes: 11 additions & 7 deletions internal/service/ec2/ec2_instance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1937,7 +1937,8 @@ func TestAccEC2Instance_rootBlockDeviceMismatch(t *testing.T) {
}

// This test reproduces the bug here:
// https://github.com/hashicorp/terraform/issues/1752
//
// https://github.com/hashicorp/terraform/issues/1752
//
// I wish there were a way to exercise resources built with helper.Schema in a
// unit context, in which case this test could be moved there, but for now this
Expand Down Expand Up @@ -5020,8 +5021,9 @@ func testAccAvailableAZsWavelengthZonesDefaultExcludeConfig() string {
}

// testAccInstanceVPCConfig returns the configuration for tests that create
// 1) a VPC without IPv6 support
// 2) a subnet in the VPC that optionally assigns public IP addresses to ENIs
// 1. a VPC without IPv6 support
// 2. a subnet in the VPC that optionally assigns public IP addresses to ENIs
//
// The resources are named 'test'.
func testAccInstanceVPCConfig(rName string, mapPublicIpOnLaunch bool, azIndex int) string {
return acctest.ConfigCompose(acctest.ConfigAvailableAZsNoOptInDefaultExclude(), fmt.Sprintf(`
Expand All @@ -5047,8 +5049,9 @@ resource "aws_subnet" "test" {
}

// testAccInstanceVPCSecurityGroupConfig returns the configuration for tests that create
// 1) a VPC security group
// 2) an internet gateway in the VPC
// 1. a VPC security group
// 2. an internet gateway in the VPC
//
// The resources are named 'test'.
func testAccInstanceVPCSecurityGroupConfig(rName string) string {
return fmt.Sprintf(`
Expand Down Expand Up @@ -5080,8 +5083,9 @@ resource "aws_security_group" "test" {
}

// testAccInstanceVPCIPv6Config returns the configuration for tests that create
// 1) a VPC with IPv6 support
// 2) a subnet in the VPC with an assigned IPv6 CIDR block
// 1. a VPC with IPv6 support
// 2. a subnet in the VPC with an assigned IPv6 CIDR block
//
// The resources are named 'test'.
func testAccInstanceVPCIPv6Config(rName string) string {
return acctest.ConfigCompose(acctest.ConfigAvailableAZsNoOptInDefaultExclude(), fmt.Sprintf(`
Expand Down
14 changes: 7 additions & 7 deletions internal/service/ec2/filters.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ import (
// In Terraform configuration this would then look like this, to constrain
// results by name:
//
// tags {
// Name = "my-awesome-subnet"
// }
// tags {
// Name = "my-awesome-subnet"
// }
func BuildTagFilterList(tags []*ec2.Tag) []*ec2.Filter {
filters := make([]*ec2.Filter, len(tags))

Expand Down Expand Up @@ -76,10 +76,10 @@ func attributeFiltersFromMultimap(m map[string][]string) []*ec2.Filter {
// attributes or tags. In Terraform configuration, the custom filter blocks
// then look like this:
//
// filter {
// name = "availabilityZone"
// values = ["us-west-2a", "us-west-2b"]
// }
// filter {
// name = "availabilityZone"
// values = ["us-west-2a", "us-west-2b"]
// }
func CustomFiltersSchema() *schema.Schema {
return &schema.Schema{
Type: schema.TypeSet,
Expand Down
2 changes: 1 addition & 1 deletion internal/service/ec2/flex.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)

//Flattens security group identifiers into a []string, where the elements returned are the GroupIDs
// Flattens security group identifiers into a []string, where the elements returned are the GroupIDs
func FlattenGroupIdentifiers(dtos []*ec2.GroupIdentifier) []string {
ids := make([]string, 0, len(dtos))
for _, v := range dtos {
Expand Down
44 changes: 21 additions & 23 deletions internal/service/ec2/vpc_security_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,6 @@ func updateSecurityGroupRules(conn *ec2.EC2, d *schema.ResourceData, ruleType st
// remote rule, which may be structured differently because of how AWS
// aggregates the rules under the to, from, and type.
//
//
// Matching rules are written to state, with their elements removed from the
// remote set
//
Expand Down Expand Up @@ -1103,39 +1102,38 @@ func SecurityGroupCollapseRules(ruleset string, rules []interface{}) []interface
//
// For example, in terraform syntax, the following block:
//
// ingress {
// from_port = 80
// to_port = 80
// protocol = "tcp"
// cidr_blocks = [
// "192.168.0.1/32",
// "192.168.0.2/32",
// ]
// }
// ingress {
// from_port = 80
// to_port = 80
// protocol = "tcp"
// cidr_blocks = [
// "192.168.0.1/32",
// "192.168.0.2/32",
// ]
// }
//
// will be converted to the two blocks below:
//
// ingress {
// from_port = 80
// to_port = 80
// protocol = "tcp"
// cidr_blocks = [ "192.168.0.1/32" ]
// }
// ingress {
// from_port = 80
// to_port = 80
// protocol = "tcp"
// cidr_blocks = [ "192.168.0.1/32" ]
// }
//
// ingress {
// from_port = 80
// to_port = 80
// protocol = "tcp"
// cidr_blocks = [ "192.168.0.2/32" ]
// }
// ingress {
// from_port = 80
// to_port = 80
// protocol = "tcp"
// cidr_blocks = [ "192.168.0.2/32" ]
// }
//
// Then the Difference operation is executed on the new set
// to find which rules got modified, and the resulting set
// is then passed to SecurityGroupCollapseRules
// to convert the "diff" back to a more compact form for
// execution. Such compact form helps reduce the number of
// API calls.
//
func SecurityGroupExpandRules(rules *schema.Set) *schema.Set {
var keys_to_expand = []string{"cidr_blocks", "ipv6_cidr_blocks", "prefix_list_ids", "security_groups"}

Expand Down
7 changes: 4 additions & 3 deletions internal/service/ec2/vpnclient_endpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ func init() {
}

// This is part of an experimental feature, do not use this as a starting point for tests
// "This place is not a place of honor... no highly esteemed deed is commemorated here... nothing valued is here.
// What is here was dangerous and repulsive to us. This message is a warning about danger."
// -- https://hyperallergic.com/312318/a-nuclear-warning-designed-to-last-10000-years/
//
// "This place is not a place of honor... no highly esteemed deed is commemorated here... nothing valued is here.
// What is here was dangerous and repulsive to us. This message is a warning about danger."
// -- https://hyperallergic.com/312318/a-nuclear-warning-designed-to-last-10000-years/
func TestAccClientVPNEndpoint_serial(t *testing.T) {
testCases := map[string]map[string]func(t *testing.T){
"Endpoint": {
Expand Down
Loading

0 comments on commit ea3f934

Please sign in to comment.