diff --git a/ecs/autoscaling.go b/ecs/autoscaling.go index f40bc7148..3e3daa74c 100644 --- a/ecs/autoscaling.go +++ b/ecs/autoscaling.go @@ -21,9 +21,9 @@ import ( "fmt" applicationautoscaling2 "github.com/aws/aws-sdk-go/service/applicationautoscaling" - "github.com/awslabs/goformation/v4/cloudformation" - "github.com/awslabs/goformation/v4/cloudformation/applicationautoscaling" - "github.com/awslabs/goformation/v4/cloudformation/iam" + "github.com/awslabs/goformation/v7/cloudformation" + "github.com/awslabs/goformation/v7/cloudformation/applicationautoscaling" + "github.com/awslabs/goformation/v7/cloudformation/iam" "github.com/compose-spec/compose-go/types" ) @@ -63,7 +63,7 @@ func (b *ecsAPIService) createAutoscalingPolicy(project *types.Project, resource role := fmt.Sprintf("%sAutoScalingRole", normalizeResourceName(service.Name)) template.Resources[role] = &iam.Role{ AssumeRolePolicyDocument: ausocalingAssumeRolePolicyDocument, - Path: "/", + Path: cloudformation.String("/"), Policies: []iam.Role_Policy{ { PolicyDocument: &PolicyDocument{ @@ -113,14 +113,14 @@ func (b *ecsAPIService) createAutoscalingPolicy(project *types.Project, resource template.Resources[policy] = &applicationautoscaling.ScalingPolicy{ PolicyType: "TargetTrackingScaling", PolicyName: policy, - ScalingTargetId: cloudformation.Ref(target), + ScalingTargetId: cloudformation.RefPtr(target), StepScalingPolicyConfiguration: nil, TargetTrackingScalingPolicyConfiguration: &applicationautoscaling.ScalingPolicy_TargetTrackingScalingPolicyConfiguration{ PredefinedMetricSpecification: &applicationautoscaling.ScalingPolicy_PredefinedMetricSpecification{ PredefinedMetricType: metric, }, - ScaleOutCooldown: 60, - ScaleInCooldown: 60, + ScaleOutCooldown: cloudformation.Int(60), + ScaleInCooldown: cloudformation.Int(60), TargetValue: float64(targetPercent), }, } diff --git a/ecs/autoscaling_test.go b/ecs/autoscaling_test.go index c8f16b5b3..892fd19d0 100644 --- a/ecs/autoscaling_test.go +++ b/ecs/autoscaling_test.go @@ -19,7 +19,7 @@ package ecs import ( "testing" - autoscaling "github.com/awslabs/goformation/v4/cloudformation/applicationautoscaling" + autoscaling "github.com/awslabs/goformation/v7/cloudformation/applicationautoscaling" "gotest.tools/v3/assert" ) diff --git a/ecs/awsResources.go b/ecs/awsResources.go index 7abb7cf94..a3f5a2a32 100644 --- a/ecs/awsResources.go +++ b/ecs/awsResources.go @@ -24,11 +24,11 @@ import ( "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/service/elbv2" - "github.com/awslabs/goformation/v4/cloudformation" - "github.com/awslabs/goformation/v4/cloudformation/ec2" - "github.com/awslabs/goformation/v4/cloudformation/ecs" - "github.com/awslabs/goformation/v4/cloudformation/efs" - "github.com/awslabs/goformation/v4/cloudformation/elasticloadbalancingv2" + "github.com/awslabs/goformation/v7/cloudformation" + "github.com/awslabs/goformation/v7/cloudformation/ec2" + "github.com/awslabs/goformation/v7/cloudformation/ecs" + "github.com/awslabs/goformation/v7/cloudformation/efs" + "github.com/awslabs/goformation/v7/cloudformation/elasticloadbalancingv2" "github.com/compose-spec/compose-go/types" "github.com/docker/compose/v2/pkg/api" "github.com/pkg/errors" @@ -322,7 +322,7 @@ func (b *ecsAPIService) ensureCluster(r *awsResources, project *types.Project, t return } template.Resources["Cluster"] = &ecs.Cluster{ - ClusterName: project.Name, + ClusterName: cloudformation.String(project.Name), Tags: projectTags(project), } r.cluster = cloudformationResource{logicalName: "Cluster"} @@ -339,16 +339,16 @@ func (b *ecsAPIService) ensureNetworks(r *awsResources, project *types.Project, securityGroup := networkResourceName(name) template.Resources[securityGroup] = &ec2.SecurityGroup{ GroupDescription: fmt.Sprintf("%s Security Group for %s network", project.Name, name), - VpcId: r.vpc, + VpcId: cloudformation.String(r.vpc), Tags: networkTags(project, net), } ingress := securityGroup + "Ingress" template.Resources[ingress] = &ec2.SecurityGroupIngress{ - Description: fmt.Sprintf("Allow communication within network %s", name), + Description: cloudformation.String(fmt.Sprintf("Allow communication within network %s", name)), IpProtocol: allProtocols, - GroupId: cloudformation.Ref(securityGroup), - SourceSecurityGroupId: cloudformation.Ref(securityGroup), + GroupId: cloudformation.RefPtr(securityGroup), + SourceSecurityGroupId: cloudformation.RefPtr(securityGroup), } r.securityGroups[name] = cloudformation.Ref(securityGroup) @@ -371,7 +371,7 @@ func (b *ecsAPIService) ensureVolumes(r *awsResources, project *types.Project, t var lifecyclePolicies []efs.FileSystem_LifecyclePolicy if policy, ok := volume.DriverOpts["lifecycle_policy"]; ok { lifecyclePolicies = append(lifecyclePolicies, efs.FileSystem_LifecyclePolicy{ - TransitionToIA: strings.TrimSpace(policy), + TransitionToIA: cloudformation.String(strings.TrimSpace(policy)), }) } @@ -391,7 +391,7 @@ func (b *ecsAPIService) ensureVolumes(r *awsResources, project *types.Project, t n := volumeResourceName(name) template.Resources[n] = &efs.FileSystem{ BackupPolicy: backupPolicy, - Encrypted: true, + Encrypted: cloudformation.Bool(true), FileSystemPolicy: nil, FileSystemTags: []efs.FileSystem_ElasticFileSystemTag{ { @@ -407,11 +407,11 @@ func (b *ecsAPIService) ensureVolumes(r *awsResources, project *types.Project, t Value: volume.Name, }, }, - KmsKeyId: kmsKeyID, + KmsKeyId: cloudformation.String(kmsKeyID), LifecyclePolicies: lifecyclePolicies, - PerformanceMode: performanceMode, - ProvisionedThroughputInMibps: provisionedThroughputInMibps, - ThroughputMode: throughputMode, + PerformanceMode: cloudformation.String(performanceMode), + ProvisionedThroughputInMibps: cloudformation.Float64(provisionedThroughputInMibps), + ThroughputMode: cloudformation.String(throughputMode), AWSCloudFormationDeletionPolicy: "Retain", } r.filesystems[name] = cloudformationResource{logicalName: n} @@ -443,17 +443,17 @@ func (b *ecsAPIService) ensureLoadBalancer(r *awsResources, project *types.Proje loadBalancerAttributes = append( loadBalancerAttributes, elasticloadbalancingv2.LoadBalancer_LoadBalancerAttribute{ - Key: "load_balancing.cross_zone.enabled", - Value: "true", + Key: cloudformation.String("load_balancing.cross_zone.enabled"), + Value: cloudformation.String("true"), }) } template.Resources["LoadBalancer"] = &elasticloadbalancingv2.LoadBalancer{ - Scheme: elbv2.LoadBalancerSchemeEnumInternetFacing, + Scheme: cloudformation.String(elbv2.LoadBalancerSchemeEnumInternetFacing), SecurityGroups: securityGroups, Subnets: r.subnetsIDs(), Tags: projectTags(project), - Type: balancerType, + Type: cloudformation.String(balancerType), LoadBalancerAttributes: loadBalancerAttributes, } r.loadBalancer = cloudformationARNResource{ diff --git a/ecs/cloudformation.go b/ecs/cloudformation.go index 774724a9b..1337ee77d 100644 --- a/ecs/cloudformation.go +++ b/ecs/cloudformation.go @@ -26,14 +26,14 @@ import ( ecsapi "github.com/aws/aws-sdk-go/service/ecs" "github.com/aws/aws-sdk-go/service/elbv2" cloudmapapi "github.com/aws/aws-sdk-go/service/servicediscovery" - "github.com/awslabs/goformation/v4/cloudformation" - "github.com/awslabs/goformation/v4/cloudformation/ec2" - "github.com/awslabs/goformation/v4/cloudformation/ecs" - "github.com/awslabs/goformation/v4/cloudformation/elasticloadbalancingv2" - "github.com/awslabs/goformation/v4/cloudformation/iam" - "github.com/awslabs/goformation/v4/cloudformation/logs" - "github.com/awslabs/goformation/v4/cloudformation/secretsmanager" - cloudmap "github.com/awslabs/goformation/v4/cloudformation/servicediscovery" + "github.com/awslabs/goformation/v7/cloudformation" + "github.com/awslabs/goformation/v7/cloudformation/ec2" + "github.com/awslabs/goformation/v7/cloudformation/ecs" + "github.com/awslabs/goformation/v7/cloudformation/elasticloadbalancingv2" + "github.com/awslabs/goformation/v7/cloudformation/iam" + "github.com/awslabs/goformation/v7/cloudformation/logs" + "github.com/awslabs/goformation/v7/cloudformation/secretsmanager" + cloudmap "github.com/awslabs/goformation/v7/cloudformation/servicediscovery" "github.com/cnabio/cnab-to-oci/remotes" "github.com/compose-spec/compose-go/types" "github.com/distribution/distribution/v3/reference" @@ -183,9 +183,9 @@ func (b *ecsAPIService) createService(project *types.Project, service types.Serv if err != nil { return err } - definition.ExecutionRoleArn = cloudformation.Ref(taskExecutionRole) + definition.ExecutionRoleArn = cloudformation.RefPtr(taskExecutionRole) if taskRole != "" { - definition.TaskRoleArn = cloudformation.Ref(taskRole) + definition.TaskRoleArn = cloudformation.RefPtr(taskRole) } taskDefinition := fmt.Sprintf("%sTaskDefinition", normalizeResourceName(service.Name)) @@ -212,9 +212,9 @@ func (b *ecsAPIService) createService(project *types.Project, service types.Serv listenerName := b.createListener(service, port, template, targetGroupName, resources.loadBalancer, protocol) dependsOn = append(dependsOn, listenerName) serviceLB = append(serviceLB, ecs.Service_LoadBalancer{ - ContainerName: service.Name, - ContainerPort: int(port.Target), - TargetGroupArn: cloudformation.Ref(targetGroupName), + ContainerName: cloudformation.String(service.Name), + ContainerPort: cloudformation.Int(int(port.Target)), + TargetGroupArn: cloudformation.RefPtr(targetGroupName), }) } @@ -247,31 +247,31 @@ func (b *ecsAPIService) createService(project *types.Project, service types.Serv template.Resources[serviceResourceName(service.Name)] = &ecs.Service{ AWSCloudFormationDependsOn: dependsOn, - Cluster: resources.cluster.ARN(), - DesiredCount: desiredCount, + Cluster: cloudformation.String(resources.cluster.ARN()), + DesiredCount: cloudformation.Int(desiredCount), DeploymentController: &ecs.Service_DeploymentController{ - Type: ecsapi.DeploymentControllerTypeEcs, + Type: cloudformation.String(ecsapi.DeploymentControllerTypeEcs), }, DeploymentConfiguration: &ecs.Service_DeploymentConfiguration{ - MaximumPercent: maxPercent, - MinimumHealthyPercent: minPercent, + MaximumPercent: cloudformation.Int(maxPercent), + MinimumHealthyPercent: cloudformation.Int(minPercent), }, - LaunchType: launchType, + LaunchType: cloudformation.String(launchType), // TODO we miss support for https://github.com/aws/containers-roadmap/issues/631 to select a capacity provider LoadBalancers: serviceLB, NetworkConfiguration: &ecs.Service_NetworkConfiguration{ AwsvpcConfiguration: &ecs.Service_AwsVpcConfiguration{ - AssignPublicIp: assignPublicIP, + AssignPublicIp: cloudformation.String(assignPublicIP), SecurityGroups: resources.serviceSecurityGroups(service), Subnets: resources.subnetsIDs(), }, }, - PlatformVersion: platformVersion, - PropagateTags: ecsapi.PropagateTagsService, - SchedulingStrategy: ecsapi.SchedulingStrategyReplica, + PlatformVersion: cloudformation.String(platformVersion), + PropagateTags: cloudformation.String(ecsapi.PropagateTagsService), + SchedulingStrategy: cloudformation.String(ecsapi.SchedulingStrategyReplica), ServiceRegistries: []ecs.Service_ServiceRegistry{serviceRegistry}, Tags: serviceTags(project, service), - TaskDefinition: cloudformation.Ref(normalizeResourceName(taskDefinition)), + TaskDefinition: cloudformation.RefPtr(normalizeResourceName(taskDefinition)), } return nil } @@ -285,12 +285,12 @@ func (b *ecsAPIService) createIngress(service types.ServiceConfig, net string, p } ingress := fmt.Sprintf("%s%dIngress", normalizeResourceName(net), port.Target) template.Resources[ingress] = &ec2.SecurityGroupIngress{ - CidrIp: "0.0.0.0/0", - Description: fmt.Sprintf("%s:%d/%s on %s network", service.Name, port.Target, port.Protocol, net), - GroupId: resources.securityGroups[net], - FromPort: int(port.Target), + CidrIp: cloudformation.String("0.0.0.0/0"), + Description: cloudformation.String(fmt.Sprintf("%s:%d/%s on %s network", service.Name, port.Target, port.Protocol, net)), + GroupId: cloudformation.String(resources.securityGroups[net]), + FromPort: cloudformation.Int(int(port.Target)), IpProtocol: protocol, - ToPort: int(port.Target), + ToPort: cloudformation.Int(int(port.Target)), } } @@ -305,8 +305,8 @@ func (b *ecsAPIService) createSecret(project *types.Project, name string, s type resource := fmt.Sprintf("%sSecret", normalizeResourceName(s.Name)) template.Resources[resource] = &secretsmanager.Secret{ - Description: fmt.Sprintf("Secret %s", s.Name), - SecretString: string(sensitiveData), + Description: cloudformation.String(fmt.Sprintf("Secret %s", s.Name)), + SecretString: cloudformation.String(string(sensitiveData)), Tags: projectTags(project), } s.Name = cloudformation.Ref(resource) @@ -321,8 +321,8 @@ func (b *ecsAPIService) createLogGroup(project *types.Project, template *cloudfo } logGroup := fmt.Sprintf("/docker-compose/%s", project.Name) template.Resources["LogGroup"] = &logs.LogGroup{ - LogGroupName: logGroup, - RetentionInDays: retention, + LogGroupName: cloudformation.String(logGroup), + RetentionInDays: cloudformation.Int(retention), } } @@ -383,7 +383,7 @@ func (b *ecsAPIService) createListener(service types.ServiceConfig, port types.S ForwardConfig: &elasticloadbalancingv2.Listener_ForwardConfig{ TargetGroups: []elasticloadbalancingv2.Listener_TargetGroupTuple{ { - TargetGroupArn: cloudformation.Ref(targetGroupName), + TargetGroupArn: cloudformation.RefPtr(targetGroupName), }, }, }, @@ -391,8 +391,8 @@ func (b *ecsAPIService) createListener(service types.ServiceConfig, port types.S }, }, LoadBalancerArn: loadBalancer.ARN(), - Protocol: protocol, - Port: int(port.Target), + Protocol: cloudformation.String(protocol), + Port: cloudformation.Int(int(port.Target)), } return listenerName } @@ -405,11 +405,11 @@ func (b *ecsAPIService) createTargetGroup(project *types.Project, service types. port.Published, ) template.Resources[targetGroupName] = &elasticloadbalancingv2.TargetGroup{ - Port: int(port.Target), - Protocol: protocol, + Port: cloudformation.Int(int(port.Target)), + Protocol: cloudformation.String(protocol), Tags: projectTags(project), - TargetType: elbv2.TargetTypeEnumIp, - VpcId: vpc, + TargetType: cloudformation.String(elbv2.TargetTypeEnumIp), + VpcId: cloudformation.String(vpc), } return targetGroupName } @@ -417,17 +417,17 @@ func (b *ecsAPIService) createTargetGroup(project *types.Project, service types. func (b *ecsAPIService) createServiceRegistry(service types.ServiceConfig, template *cloudformation.Template, healthCheck *cloudmap.Service_HealthCheckConfig) ecs.Service_ServiceRegistry { serviceRegistration := fmt.Sprintf("%sServiceDiscoveryEntry", normalizeResourceName(service.Name)) serviceRegistry := ecs.Service_ServiceRegistry{ - RegistryArn: cloudformation.GetAtt(serviceRegistration, "Arn"), + RegistryArn: cloudformation.GetAttPtr(serviceRegistration, "Arn"), } template.Resources[serviceRegistration] = &cloudmap.Service{ - Description: fmt.Sprintf("%q service discovery entry in Cloud Map", service.Name), + Description: cloudformation.String(fmt.Sprintf("%q service discovery entry in Cloud Map", service.Name)), HealthCheckConfig: healthCheck, HealthCheckCustomConfig: &cloudmap.Service_HealthCheckCustomConfig{ - FailureThreshold: 1, + FailureThreshold: cloudformation.Float64(1), }, - Name: service.Name, - NamespaceId: cloudformation.Ref("CloudMap"), + Name: cloudformation.String(service.Name), + NamespaceId: cloudformation.RefPtr("CloudMap"), DnsConfig: &cloudmap.Service_DnsConfig{ DnsRecords: []cloudmap.Service_DnsRecord{ { @@ -435,7 +435,7 @@ func (b *ecsAPIService) createServiceRegistry(service types.ServiceConfig, templ Type: cloudmapapi.RecordTypeA, }, }, - RoutingPolicy: cloudmapapi.RoutingPolicyMultivalue, + RoutingPolicy: cloudformation.String(cloudmapapi.RoutingPolicyMultivalue), }, } return serviceRegistry @@ -498,7 +498,7 @@ func (b *ecsAPIService) createTaskRole(project *types.Project, service types.Ser func (b *ecsAPIService) createCloudMap(project *types.Project, template *cloudformation.Template, vpc string) { template.Resources["CloudMap"] = &cloudmap.PrivateDnsNamespace{ - Description: fmt.Sprintf("Service Map for Docker Compose project %s", project.Name), + Description: cloudformation.String(fmt.Sprintf("Service Map for Docker Compose project %s", project.Name)), Name: fmt.Sprintf("%s.local", project.Name), Vpc: vpc, } diff --git a/ecs/cloudformation_test.go b/ecs/cloudformation_test.go index 8f33c08ae..f7e583b62 100644 --- a/ecs/cloudformation_test.go +++ b/ecs/cloudformation_test.go @@ -25,13 +25,13 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/elbv2" - "github.com/awslabs/goformation/v4/cloudformation" - "github.com/awslabs/goformation/v4/cloudformation/ec2" - "github.com/awslabs/goformation/v4/cloudformation/ecs" - "github.com/awslabs/goformation/v4/cloudformation/efs" - "github.com/awslabs/goformation/v4/cloudformation/elasticloadbalancingv2" - "github.com/awslabs/goformation/v4/cloudformation/iam" - "github.com/awslabs/goformation/v4/cloudformation/logs" + "github.com/awslabs/goformation/v7/cloudformation" + "github.com/awslabs/goformation/v7/cloudformation/ec2" + "github.com/awslabs/goformation/v7/cloudformation/ecs" + "github.com/awslabs/goformation/v7/cloudformation/efs" + "github.com/awslabs/goformation/v7/cloudformation/elasticloadbalancingv2" + "github.com/awslabs/goformation/v7/cloudformation/iam" + "github.com/awslabs/goformation/v7/cloudformation/logs" "github.com/compose-spec/compose-go/loader" "github.com/compose-spec/compose-go/types" "github.com/docker/compose/v2/pkg/api" @@ -71,7 +71,7 @@ x-aws-logs_retention: 10 } logGroup := template.Resources["LogGroup"].(*logs.LogGroup) - assert.Equal(t, logGroup.RetentionInDays, 10) + assert.Equal(t, cloudformation.IntValue(logGroup.RetentionInDays), 10) } func TestEnvFile(t *testing.T) { @@ -86,8 +86,8 @@ services: env := getMainContainer(def, t).Environment var found bool for _, pair := range env { - if pair.Name == "FOO" { - assert.Equal(t, pair.Value, "BAR") + if cloudformation.StringValue(pair.Name) == "FOO" { + assert.Equal(t, cloudformation.StringValue(pair.Value), "BAR") found = true } } @@ -108,8 +108,8 @@ services: env := getMainContainer(def, t).Environment var found bool for _, pair := range env { - if pair.Name == "FOO" { - assert.Equal(t, pair.Value, "ZOT") + if cloudformation.StringValue(pair.Name) == "FOO" { + assert.Equal(t, cloudformation.StringValue(pair.Value), "ZOT") found = true } } @@ -122,13 +122,13 @@ services: foo: image: hello_world deploy: - replicas: 4 + replicas: 4 update_config: parallelism: 2 `, nil, useDefaultVPC) service := template.Resources["FooService"].(*ecs.Service) - assert.Check(t, service.DeploymentConfiguration.MaximumPercent == 150) - assert.Check(t, service.DeploymentConfiguration.MinimumHealthyPercent == 50) + assert.Check(t, cloudformation.IntValue(service.DeploymentConfiguration.MaximumPercent) == 150) + assert.Check(t, cloudformation.IntValue(service.DeploymentConfiguration.MinimumHealthyPercent) == 50) } func TestRollingUpdateExtension(t *testing.T) { @@ -142,8 +142,8 @@ services: x-aws-max_percent: 125 `, nil, useDefaultVPC) service := template.Resources["FooService"].(*ecs.Service) - assert.Check(t, service.DeploymentConfiguration.MaximumPercent == 125) - assert.Check(t, service.DeploymentConfiguration.MinimumHealthyPercent == 25) + assert.Check(t, cloudformation.IntValue(service.DeploymentConfiguration.MaximumPercent) == 125) + assert.Check(t, cloudformation.IntValue(service.DeploymentConfiguration.MinimumHealthyPercent) == 25) } func TestRolePolicy(t *testing.T) { @@ -187,7 +187,7 @@ networks: i := template.Resources["FronttierNetworkIngress"] assert.Check(t, i != nil) ingress := *i.(*ec2.SecurityGroupIngress) - assert.Check(t, ingress.SourceSecurityGroupId == cloudformation.Ref("FronttierNetwork")) + assert.Check(t, cloudformation.StringValue(ingress.SourceSecurityGroupId) == cloudformation.Ref("FronttierNetwork")) } @@ -212,8 +212,8 @@ func TestLoadBalancerTypeApplication(t *testing.T) { lb := template.Resources["LoadBalancer"] assert.Check(t, lb != nil) loadBalancer := *lb.(*elasticloadbalancingv2.LoadBalancer) - assert.Check(t, len(loadBalancer.Name) <= 32) - assert.Check(t, loadBalancer.Type == elbv2.LoadBalancerTypeEnumApplication) + assert.Check(t, len(cloudformation.StringValue(loadBalancer.Name)) <= 32) + assert.Check(t, cloudformation.StringValue(loadBalancer.Type) == elbv2.LoadBalancerTypeEnumApplication) assert.Check(t, len(loadBalancer.SecurityGroups) > 0) } } @@ -244,7 +244,7 @@ services: s := template.Resources["TestService"] assert.Check(t, s != nil) service := *s.(*ecs.Service) - assert.Check(t, service.DesiredCount == 10) + assert.Check(t, cloudformation.IntValue(service.DesiredCount) == 10) } func TestTaskSizeConvert(t *testing.T) { @@ -254,8 +254,8 @@ services: image: nginx `, nil, useDefaultVPC) def := template.Resources["TestTaskDefinition"].(*ecs.TaskDefinition) - assert.Equal(t, def.Cpu, "256") - assert.Equal(t, def.Memory, "512") + assert.Equal(t, cloudformation.StringValue(def.Cpu), "256") + assert.Equal(t, cloudformation.StringValue(def.Memory), "512") template = convertYaml(t, ` services: @@ -268,8 +268,8 @@ services: memory: 2048M `, nil, useDefaultVPC) def = template.Resources["TestTaskDefinition"].(*ecs.TaskDefinition) - assert.Equal(t, def.Cpu, "512") - assert.Equal(t, def.Memory, "2048") + assert.Equal(t, cloudformation.StringValue(def.Cpu), "512") + assert.Equal(t, cloudformation.StringValue(def.Memory), "2048") template = convertYaml(t, ` services: @@ -282,8 +282,8 @@ services: memory: 8192M `, nil, useDefaultVPC) def = template.Resources["TestTaskDefinition"].(*ecs.TaskDefinition) - assert.Equal(t, def.Cpu, "4096") - assert.Equal(t, def.Memory, "8192") + assert.Equal(t, cloudformation.StringValue(def.Cpu), "4096") + assert.Equal(t, cloudformation.StringValue(def.Memory), "8192") template = convertYaml(t, ` services: @@ -295,14 +295,14 @@ services: cpus: '4' memory: 792Mb reservations: - generic_resources: + generic_resources: - discrete_resource_spec: kind: gpus value: 2 `, nil, useDefaultVPC, useGPU) def = template.Resources["TestTaskDefinition"].(*ecs.TaskDefinition) - assert.Equal(t, def.Cpu, "4000") - assert.Equal(t, def.Memory, "792") + assert.Equal(t, cloudformation.StringValue(def.Cpu), "4000") + assert.Equal(t, cloudformation.StringValue(def.Memory), "792") template = convertYaml(t, ` services: @@ -311,14 +311,14 @@ services: deploy: resources: reservations: - generic_resources: + generic_resources: - discrete_resource_spec: kind: gpus value: 2 `, nil, useDefaultVPC, useGPU) def = template.Resources["TestTaskDefinition"].(*ecs.TaskDefinition) - assert.Equal(t, def.Cpu, "") - assert.Equal(t, def.Memory, "") + assert.Equal(t, cloudformation.StringValue(def.Cpu), "") + assert.Equal(t, cloudformation.StringValue(def.Memory), "") template = convertYaml(t, ` services: @@ -327,13 +327,13 @@ services: deploy: resources: reservations: - devices: + devices: - capabilities: [gpu] count: 2 `, nil, useDefaultVPC, useGPU) def = template.Resources["TestTaskDefinition"].(*ecs.TaskDefinition) - assert.Equal(t, def.Cpu, "") - assert.Equal(t, def.Memory, "") + assert.Equal(t, cloudformation.StringValue(def.Cpu), "") + assert.Equal(t, cloudformation.StringValue(def.Memory), "") } func TestLoadBalancerTypeNetwork(t *testing.T) { @@ -348,7 +348,7 @@ services: lb := template.Resources["LoadBalancer"] assert.Check(t, lb != nil) loadBalancer := *lb.(*elasticloadbalancingv2.LoadBalancer) - assert.Check(t, loadBalancer.Type == elbv2.LoadBalancerTypeEnumNetwork) + assert.Check(t, cloudformation.StringValue(loadBalancer.Type) == elbv2.LoadBalancerTypeEnumNetwork) } func TestUseExternalNetwork(t *testing.T) { @@ -397,7 +397,7 @@ services: test: image: nginx volumes: - db-data: + db-data: driver_opts: backup_policy: ENABLED lifecycle_policy: AFTER_30_DAYS @@ -412,12 +412,12 @@ volumes: }) n := volumeResourceName("db-data") f := template.Resources[n].(*efs.FileSystem) - assert.Check(t, f != nil) //nolint:staticcheck - assert.Equal(t, f.BackupPolicy.Status, "ENABLED") //nolint:staticcheck - assert.Equal(t, f.LifecyclePolicies[0].TransitionToIA, "AFTER_30_DAYS") //nolint:staticcheck - assert.Equal(t, f.PerformanceMode, "maxIO") //nolint:staticcheck - assert.Equal(t, f.ThroughputMode, "provisioned") //nolint:staticcheck - assert.Equal(t, f.ProvisionedThroughputInMibps, float64(1024)) //nolint:staticcheck + assert.Check(t, f != nil) //nolint:staticcheck + assert.Equal(t, f.BackupPolicy.Status, "ENABLED") //nolint:staticcheck + assert.Equal(t, cloudformation.StringValue(f.LifecyclePolicies[0].TransitionToIA), "AFTER_30_DAYS") //nolint:staticcheck + assert.Equal(t, cloudformation.StringValue(f.PerformanceMode), "maxIO") //nolint:staticcheck + assert.Equal(t, cloudformation.StringValue(f.ThroughputMode), "provisioned") //nolint:staticcheck + assert.Equal(t, cloudformation.Float64Value(f.ProvisionedThroughputInMibps), float64(1024)) //nolint:staticcheck s := template.Resources["DbdataNFSMountTargetOnSubnet1"].(*efs.MountTarget) assert.Check(t, s != nil) //nolint:staticcheck @@ -507,17 +507,17 @@ services: assert.Equal(t, container.Command[0], "command") assert.Equal(t, container.EntryPoint[0], "entrypoint") assert.Equal(t, get(container.Environment, "FOO"), "BAR") - assert.Check(t, container.LinuxParameters.InitProcessEnabled) + assert.Check(t, cloudformation.BoolValue(container.LinuxParameters.InitProcessEnabled)) assert.Equal(t, container.LinuxParameters.Capabilities.Add[0], "SYS_PTRACE") assert.Equal(t, container.LinuxParameters.Capabilities.Drop[0], "SYSLOG") - assert.Equal(t, container.User, "user") - assert.Equal(t, container.WorkingDirectory, "working_dir") + assert.Equal(t, cloudformation.StringValue(container.User), "user") + assert.Equal(t, cloudformation.StringValue(container.WorkingDirectory), "working_dir") } func get(l []ecs.TaskDefinition_KeyValuePair, name string) string { for _, e := range l { - if e.Name == name { - return e.Value + if cloudformation.StringValue(e.Name) == name { + return cloudformation.StringValue(e.Value) } } return "" @@ -618,7 +618,7 @@ func loadConfig(t *testing.T, yaml string) *types.Project { func getMainContainer(def *ecs.TaskDefinition, t *testing.T) ecs.TaskDefinition_ContainerDefinition { for _, c := range def.ContainerDefinitions { - if c.Essential { + if cloudformation.BoolValue(c.Essential) { return c } } diff --git a/ecs/convert.go b/ecs/convert.go index be1deedc9..af0bccfa7 100644 --- a/ecs/convert.go +++ b/ecs/convert.go @@ -29,8 +29,8 @@ import ( "github.com/docker/compose-cli/ecs/secrets" ecsapi "github.com/aws/aws-sdk-go/service/ecs" - "github.com/awslabs/goformation/v4/cloudformation" - "github.com/awslabs/goformation/v4/cloudformation/ecs" + "github.com/awslabs/goformation/v7/cloudformation" + "github.com/awslabs/goformation/v7/cloudformation/ecs" "github.com/compose-spec/compose-go/types" "github.com/docker/cli/opts" "github.com/joho/godotenv" @@ -67,7 +67,7 @@ func (b *ecsAPIService) createTaskDefinition(project *types.Project, service typ initContainers = append(initContainers, ecs.TaskDefinition_ContainerDefinition{ Name: fmt.Sprintf("%s_ResolvConf_InitContainer", normalizeResourceName(service.Name)), Image: searchDomainInitContainerImage, - Essential: false, + Essential: cloudformation.Bool(false), Command: []string{b.Region + ".compute.internal", project.Name + ".local"}, LogConfiguration: logConfiguration, }) @@ -75,8 +75,8 @@ func (b *ecsAPIService) createTaskDefinition(project *types.Project, service typ var dependencies []ecs.TaskDefinition_ContainerDependency for _, c := range initContainers { dependencies = append(dependencies, ecs.TaskDefinition_ContainerDependency{ - Condition: ecsapi.ContainerConditionSuccess, - ContainerName: c.Name, + Condition: cloudformation.String(ecsapi.ContainerConditionSuccess), + ContainerName: cloudformation.String(c.Name), }) } @@ -85,18 +85,18 @@ func (b *ecsAPIService) createTaskDefinition(project *types.Project, service typ volumes = append(volumes, ecs.TaskDefinition_Volume{ EFSVolumeConfiguration: &ecs.TaskDefinition_EFSVolumeConfiguration{ AuthorizationConfig: &ecs.TaskDefinition_AuthorizationConfig{ - AccessPointId: cloudformation.Ref(n), - IAM: "ENABLED", + AccessPointId: cloudformation.RefPtr(n), + IAM: cloudformation.String("ENABLED"), }, FilesystemId: resources.filesystems[v.Source].ID(), - TransitEncryption: "ENABLED", + TransitEncryption: cloudformation.String("ENABLED"), }, - Name: v.Source, + Name: cloudformation.String(v.Source), }) mounts = append(mounts, ecs.TaskDefinition_MountPoint{ - ContainerPath: v.Target, - ReadOnly: v.ReadOnly, - SourceVolume: v.Source, + ContainerPath: cloudformation.String(v.Target), + ReadOnly: cloudformation.Bool(v.ReadOnly), + SourceVolume: cloudformation.String(v.Source), }) } @@ -111,7 +111,7 @@ func (b *ecsAPIService) createTaskDefinition(project *types.Project, service typ containers := append(initContainers, ecs.TaskDefinition_ContainerDefinition{ Command: service.Command, - DisableNetworking: service.NetworkMode == "none", + DisableNetworking: cloudformation.Bool(service.NetworkMode == "none"), DependsOnProp: dependencies, DnsSearchDomains: service.DNSSearch, DnsServers: service.DNS, @@ -119,32 +119,32 @@ func (b *ecsAPIService) createTaskDefinition(project *types.Project, service typ DockerSecurityOptions: service.SecurityOpt, EntryPoint: service.Entrypoint, Environment: pairs, - Essential: true, + Essential: cloudformation.Bool(true), ExtraHosts: toHostEntryPtr(service.ExtraHosts), FirelensConfiguration: nil, HealthCheck: toHealthCheck(service.HealthCheck), - Hostname: service.Hostname, + Hostname: cloudformation.String(service.Hostname), Image: service.Image, - Interactive: false, + Interactive: cloudformation.Bool(false), Links: nil, LinuxParameters: toLinuxParameters(service), LogConfiguration: logConfiguration, - MemoryReservation: memReservation, + MemoryReservation: cloudformation.Int(memReservation), MountPoints: mounts, Name: service.Name, PortMappings: toPortMappings(service.Ports), - Privileged: service.Privileged, - PseudoTerminal: service.Tty, - ReadonlyRootFilesystem: service.ReadOnly, + Privileged: cloudformation.Bool(service.Privileged), + PseudoTerminal: cloudformation.Bool(service.Tty), + ReadonlyRootFilesystem: cloudformation.Bool(service.ReadOnly), RepositoryCredentials: credential, ResourceRequirements: toTaskResourceRequirements(reservations), - StartTimeout: 0, - StopTimeout: durationToInt(service.StopGracePeriod), + StartTimeout: cloudformation.Int(0), + StopTimeout: cloudformation.Int(durationToInt(service.StopGracePeriod)), SystemControls: toSystemControls(service.Sysctls), Ulimits: toUlimits(service.Ulimits), - User: service.User, + User: cloudformation.String(service.User), VolumesFrom: nil, - WorkingDirectory: service.WorkingDir, + WorkingDirectory: cloudformation.String(service.WorkingDir), }) launchType := ecsapi.LaunchTypeFargate @@ -154,12 +154,12 @@ func (b *ecsAPIService) createTaskDefinition(project *types.Project, service typ return &ecs.TaskDefinition{ ContainerDefinitions: containers, - Cpu: cpu, - Family: fmt.Sprintf("%s-%s", project.Name, service.Name), - IpcMode: service.Ipc, - Memory: mem, - NetworkMode: ecsapi.NetworkModeAwsvpc, // FIXME could be set by service.NetworkMode, Fargate only supports network mode ‘awsvpc’. - PidMode: service.Pid, + Cpu: cloudformation.String(cpu), + Family: cloudformation.String(fmt.Sprintf("%s-%s", project.Name, service.Name)), + IpcMode: cloudformation.String(service.Ipc), + Memory: cloudformation.String(mem), + NetworkMode: cloudformation.String(ecsapi.NetworkModeAwsvpc), // FIXME could be set by service.NetworkMode, Fargate only supports network mode ‘awsvpc’. + PidMode: cloudformation.String(service.Pid), PlacementConstraints: toPlacementConstraints(service.Deploy), ProxyConfiguration: nil, RequiresCompatibilities: []string{ @@ -211,12 +211,12 @@ func createSecretsSideCar(project *types.Project, service types.ServiceConfig, l error) { initContainerName := fmt.Sprintf("%s_Secrets_InitContainer", normalizeResourceName(service.Name)) secretsVolume := ecs.TaskDefinition_Volume{ - Name: "secrets", + Name: cloudformation.String("secrets"), } secretsMount := ecs.TaskDefinition_MountPoint{ - ContainerPath: "/run/secrets/", - ReadOnly: true, - SourceVolume: "secrets", + ContainerPath: cloudformation.String("/run/secrets/"), + ReadOnly: cloudformation.Bool(true), + SourceVolume: cloudformation.String("secrets"), } var ( @@ -255,13 +255,13 @@ func createSecretsSideCar(project *types.Project, service types.ServiceConfig, l Name: initContainerName, Image: secretsInitContainerImage, Command: []string{string(command)}, - Essential: false, // FIXME this will be ignored, see https://github.com/awslabs/goformation/issues/61#issuecomment-625139607 + Essential: cloudformation.Bool(false), LogConfiguration: logConfiguration, MountPoints: []ecs.TaskDefinition_MountPoint{ { - ContainerPath: "/run/secrets/", - ReadOnly: false, - SourceVolume: "secrets", + ContainerPath: cloudformation.String("/run/secrets/"), + ReadOnly: cloudformation.Bool(false), + SourceVolume: cloudformation.String("secrets"), }, }, Secrets: taskSecrets, @@ -304,15 +304,15 @@ func createEnvironment(project *types.Project, service types.ServiceConfig) ([]e value = *v } pairs = append(pairs, ecs.TaskDefinition_KeyValuePair{ - Name: name, - Value: value, + Name: cloudformation.String(name), + Value: cloudformation.String(value), }) } //order env keys for idempotence between calls //to avoid unnecessary resource recreations on CloudFormation sort.Slice(pairs, func(i, j int) bool { - return pairs[i].Name < pairs[j].Name + return cloudformation.StringValue(pairs[i].Name) < cloudformation.StringValue(pairs[j].Name) }) return pairs, nil @@ -342,8 +342,8 @@ func toSystemControls(sysctls types.Mapping) []ecs.TaskDefinition_SystemControl sys := []ecs.TaskDefinition_SystemControl{} for k, v := range sysctls { sys = append(sys, ecs.TaskDefinition_SystemControl{ - Namespace: k, - Value: v, + Namespace: cloudformation.String(k), + Value: cloudformation.String(v), }) } return sys @@ -449,7 +449,7 @@ func toPlacementConstraints(deploy *types.DeployConfig) []ecs.TaskDefinition_Tas pl := []ecs.TaskDefinition_TaskDefinitionPlacementConstraint{} for _, c := range deploy.Placement.Constraints { pl = append(pl, ecs.TaskDefinition_TaskDefinitionPlacementConstraint{ - Expression: c, + Expression: cloudformation.String(c), Type: "", }) } @@ -463,9 +463,9 @@ func toPortMappings(ports []types.ServicePortConfig) []ecs.TaskDefinition_PortMa m := []ecs.TaskDefinition_PortMapping{} for _, p := range ports { m = append(m, ecs.TaskDefinition_PortMapping{ - ContainerPort: int(p.Target), - HostPort: int(p.Published), - Protocol: p.Protocol, + ContainerPort: cloudformation.Int(int(p.Target)), + HostPort: cloudformation.Int(int(p.Published)), + Protocol: cloudformation.String(p.Protocol), }) } return m @@ -490,10 +490,10 @@ func toLinuxParameters(service types.ServiceConfig) *ecs.TaskDefinition_LinuxPar return &ecs.TaskDefinition_LinuxParameters{ Capabilities: toKernelCapabilities(service.CapAdd, service.CapDrop), Devices: nil, - InitProcessEnabled: service.Init != nil && *service.Init, - MaxSwap: 0, + InitProcessEnabled: cloudformation.Bool(service.Init != nil && *service.Init), + MaxSwap: cloudformation.Int(0), // FIXME SharedMemorySize: service.ShmSize, - Swappiness: 0, + Swappiness: cloudformation.Int(0), Tmpfs: toTmpfs(service.Tmpfs), } } @@ -505,7 +505,7 @@ func toTmpfs(tmpfs types.StringList) []ecs.TaskDefinition_Tmpfs { o := []ecs.TaskDefinition_Tmpfs{} for _, path := range tmpfs { o = append(o, ecs.TaskDefinition_Tmpfs{ - ContainerPath: path, + ContainerPath: cloudformation.String(path), Size: 100, // size is required on ECS, unlimited by the compose spec }) } @@ -533,10 +533,10 @@ func toHealthCheck(check *types.HealthCheckConfig) *ecs.TaskDefinition_HealthChe } return &ecs.TaskDefinition_HealthCheck{ Command: check.Test, - Interval: durationToInt(check.Interval), - Retries: retries, - StartPeriod: durationToInt(check.StartPeriod), - Timeout: durationToInt(check.Timeout), + Interval: cloudformation.Int(durationToInt(check.Interval)), + Retries: cloudformation.Int(retries), + StartPeriod: cloudformation.Int(durationToInt(check.StartPeriod)), + Timeout: cloudformation.Int(durationToInt(check.Timeout)), } } @@ -556,8 +556,8 @@ func toHostEntryPtr(hosts types.HostsList) []ecs.TaskDefinition_HostEntry { for _, h := range hosts { parts := strings.SplitN(h, ":", 2) // FIXME this should be handled by compose-go e = append(e, ecs.TaskDefinition_HostEntry{ - Hostname: parts[0], - IpAddress: parts[1], + Hostname: cloudformation.String(parts[0]), + IpAddress: cloudformation.String(parts[1]), }) } return e @@ -565,7 +565,7 @@ func toHostEntryPtr(hosts types.HostsList) []ecs.TaskDefinition_HostEntry { func getRepoCredentials(service types.ServiceConfig) *ecs.TaskDefinition_RepositoryCredentials { if value, ok := service.Extensions[extensionPullCredentials]; ok { - return &ecs.TaskDefinition_RepositoryCredentials{CredentialsParameter: value.(string)} + return &ecs.TaskDefinition_RepositoryCredentials{CredentialsParameter: cloudformation.String(value.(string))} } return nil } diff --git a/ecs/ec2.go b/ecs/ec2.go index 8556135c6..2718d2162 100644 --- a/ecs/ec2.go +++ b/ecs/ec2.go @@ -22,10 +22,10 @@ import ( "fmt" "strings" - "github.com/awslabs/goformation/v4/cloudformation" - "github.com/awslabs/goformation/v4/cloudformation/autoscaling" - "github.com/awslabs/goformation/v4/cloudformation/ecs" - "github.com/awslabs/goformation/v4/cloudformation/iam" + "github.com/awslabs/goformation/v7/cloudformation" + "github.com/awslabs/goformation/v7/cloudformation/autoscaling" + "github.com/awslabs/goformation/v7/cloudformation/ecs" + "github.com/awslabs/goformation/v7/cloudformation/iam" "github.com/compose-spec/compose-go/types" ) @@ -73,14 +73,14 @@ func (b *ecsAPIService) createCapacityProvider(ctx context.Context, project *typ AutoScalingGroupProvider: &ecs.CapacityProvider_AutoScalingGroupProvider{ AutoScalingGroupArn: cloudformation.Ref("AutoscalingGroup"), ManagedScaling: &ecs.CapacityProvider_ManagedScaling{ - TargetCapacity: 100, + TargetCapacity: cloudformation.Int(100), }, }, Tags: projectTags(project), } template.Resources["AutoscalingGroup"] = &autoscaling.AutoScalingGroup{ - LaunchConfigurationName: cloudformation.Ref("LaunchConfiguration"), + LaunchConfigurationName: cloudformation.RefPtr("LaunchConfiguration"), MaxSize: "10", //TODO MinSize: "1", VPCZoneIdentifier: resources.subnetsIDs(), @@ -93,8 +93,8 @@ func (b *ecsAPIService) createCapacityProvider(ctx context.Context, project *typ ImageId: ami, InstanceType: machineType, SecurityGroups: resources.allSecurityGroups(), - IamInstanceProfile: cloudformation.Ref("EC2InstanceProfile"), - UserData: userData, + IamInstanceProfile: cloudformation.RefPtr("EC2InstanceProfile"), + UserData: cloudformation.String(userData), } template.Resources["EC2InstanceProfile"] = &iam.InstanceProfile{ diff --git a/ecs/ec2_test.go b/ecs/ec2_test.go index bd6819816..a090df909 100644 --- a/ecs/ec2_test.go +++ b/ecs/ec2_test.go @@ -19,7 +19,7 @@ package ecs import ( "testing" - "github.com/awslabs/goformation/v4/cloudformation/autoscaling" + "github.com/awslabs/goformation/v7/cloudformation/autoscaling" "gotest.tools/v3/assert" ) diff --git a/ecs/iam.go b/ecs/iam.go index f6b80ed24..a0c4d190c 100644 --- a/ecs/iam.go +++ b/ecs/iam.go @@ -19,7 +19,7 @@ package ecs import ( "fmt" - "github.com/awslabs/goformation/v4/cloudformation" + "github.com/awslabs/goformation/v7/cloudformation" ) const ( diff --git a/ecs/local/compose.go b/ecs/local/compose.go index d962e190a..09213b34e 100644 --- a/ecs/local/compose.go +++ b/ecs/local/compose.go @@ -26,7 +26,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/compose-spec/compose-go/types" "github.com/pkg/errors" - "github.com/sanathkr/go-yaml" + "gopkg.in/yaml.v3" "github.com/docker/compose/v2/pkg/api" ) diff --git a/ecs/marshall.go b/ecs/marshall.go index 2a70b040a..99d422fca 100644 --- a/ecs/marshall.go +++ b/ecs/marshall.go @@ -21,8 +21,8 @@ import ( "fmt" "strings" - "github.com/awslabs/goformation/v4/cloudformation" - "github.com/sanathkr/go-yaml" + "github.com/awslabs/goformation/v7/cloudformation" + "gopkg.in/yaml.v3" ) func marshall(template *cloudformation.Template, format string) ([]byte, error) { diff --git a/ecs/tags.go b/ecs/tags.go index 6449e796e..e6e67d922 100644 --- a/ecs/tags.go +++ b/ecs/tags.go @@ -17,7 +17,7 @@ package ecs import ( - "github.com/awslabs/goformation/v4/cloudformation/tags" + "github.com/awslabs/goformation/v7/cloudformation/tags" "github.com/compose-spec/compose-go/types" "github.com/docker/compose/v2/pkg/api" ) diff --git a/ecs/testdata/simple-cloudformation-conversion.golden b/ecs/testdata/simple-cloudformation-conversion.golden index 7f82eb5f0..40ba39f8b 100644 --- a/ecs/testdata/simple-cloudformation-conversion.golden +++ b/ecs/testdata/simple-cloudformation-conversion.golden @@ -1,208 +1,225 @@ -AWSTemplateFormatVersion: 2010-09-09 +AWSTemplateFormatVersion: "2010-09-09" Resources: - CloudMap: - Properties: - Description: Service Map for Docker Compose project TestSimpleConvert - Name: TestSimpleConvert.local - Vpc: vpc-123 - Type: AWS::ServiceDiscovery::PrivateDnsNamespace - Cluster: - Properties: - ClusterName: TestSimpleConvert - Tags: - - Key: com.docker.compose.project - Value: TestSimpleConvert - Type: AWS::ECS::Cluster - Default80Ingress: - Properties: - CidrIp: 0.0.0.0/0 - Description: simple:80/tcp on default network - FromPort: 80 - GroupId: - Ref: DefaultNetwork - IpProtocol: TCP - ToPort: 80 - Type: AWS::EC2::SecurityGroupIngress - DefaultNetwork: - Properties: - GroupDescription: TestSimpleConvert Security Group for default network - Tags: - - Key: com.docker.compose.project - Value: TestSimpleConvert - - Key: com.docker.compose.network - Value: TestSimpleConvert_default - VpcId: vpc-123 - Type: AWS::EC2::SecurityGroup - DefaultNetworkIngress: - Properties: - Description: Allow communication within network default - GroupId: - Ref: DefaultNetwork - IpProtocol: "-1" - SourceSecurityGroupId: - Ref: DefaultNetwork - Type: AWS::EC2::SecurityGroupIngress - LoadBalancer: - Properties: - Scheme: internet-facing - SecurityGroups: - - Ref: DefaultNetwork - Subnets: - - subnet1 - - subnet2 - Tags: - - Key: com.docker.compose.project - Value: TestSimpleConvert - Type: application - Type: AWS::ElasticLoadBalancingV2::LoadBalancer - LogGroup: - Properties: - LogGroupName: /docker-compose/TestSimpleConvert - Type: AWS::Logs::LogGroup - SimpleService: - DependsOn: - - SimpleTCP80Listener - Properties: - Cluster: - Fn::GetAtt: - - Cluster - - Arn - DeploymentConfiguration: - MaximumPercent: 200 - MinimumHealthyPercent: 100 - DeploymentController: - Type: ECS - DesiredCount: 1 - LaunchType: FARGATE - LoadBalancers: - - ContainerName: simple - ContainerPort: 80 - TargetGroupArn: - Ref: SimpleTCP80TargetGroup - NetworkConfiguration: - AwsvpcConfiguration: - AssignPublicIp: ENABLED - SecurityGroups: - - Ref: DefaultNetwork - Subnets: - - subnet1 - - subnet2 - PlatformVersion: 1.4.0 - PropagateTags: SERVICE - SchedulingStrategy: REPLICA - ServiceRegistries: - - RegistryArn: - Fn::GetAtt: - - SimpleServiceDiscoveryEntry - - Arn - Tags: - - Key: com.docker.compose.project - Value: TestSimpleConvert - - Key: com.docker.compose.service - Value: simple - TaskDefinition: - Ref: SimpleTaskDefinition - Type: AWS::ECS::Service - SimpleServiceDiscoveryEntry: - Properties: - Description: '"simple" service discovery entry in Cloud Map' - DnsConfig: - DnsRecords: - - TTL: 60 - Type: A - RoutingPolicy: MULTIVALUE - HealthCheckCustomConfig: - FailureThreshold: 1 - Name: simple - NamespaceId: - Ref: CloudMap - Type: AWS::ServiceDiscovery::Service - SimpleTCP80Listener: - Properties: - DefaultActions: - - ForwardConfig: - TargetGroups: - - TargetGroupArn: - Ref: SimpleTCP80TargetGroup - Type: forward - LoadBalancerArn: - Ref: LoadBalancer - Port: 80 - Protocol: HTTP - Type: AWS::ElasticLoadBalancingV2::Listener - SimpleTCP80TargetGroup: - Properties: - Port: 80 - Protocol: HTTP - Tags: - - Key: com.docker.compose.project - Value: TestSimpleConvert - TargetType: ip - VpcId: vpc-123 - Type: AWS::ElasticLoadBalancingV2::TargetGroup - SimpleTaskDefinition: - Properties: - ContainerDefinitions: - - Command: - - .compute.internal - - TestSimpleConvert.local - Essential: false - Image: docker/ecs-searchdomain-sidecar:1.0 - LogConfiguration: - LogDriver: awslogs - Options: - awslogs-group: - Ref: LogGroup - awslogs-region: - Ref: AWS::Region - awslogs-stream-prefix: TestSimpleConvert - Name: Simple_ResolvConf_InitContainer - - DependsOn: - - Condition: SUCCESS - ContainerName: Simple_ResolvConf_InitContainer - Essential: true - Image: nginx - LinuxParameters: {} - LogConfiguration: - LogDriver: awslogs - Options: - awslogs-group: - Ref: LogGroup - awslogs-region: - Ref: AWS::Region - awslogs-stream-prefix: TestSimpleConvert - Name: simple - PortMappings: - - ContainerPort: 80 - HostPort: 80 - Protocol: tcp - Cpu: "256" - ExecutionRoleArn: - Ref: SimpleTaskExecutionRole - Family: TestSimpleConvert-simple - Memory: "512" - NetworkMode: awsvpc - RequiresCompatibilities: - - FARGATE - Type: AWS::ECS::TaskDefinition - SimpleTaskExecutionRole: - Properties: - AssumeRolePolicyDocument: - Statement: - - Action: - - sts:AssumeRole - Condition: {} - Effect: Allow - Principal: - Service: ecs-tasks.amazonaws.com - Version: 2012-10-17 - ManagedPolicyArns: - - arn:aws:iam::aws:policy/service-role/AmazonECSTaskExecutionRolePolicy - - arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly - Tags: - - Key: com.docker.compose.project - Value: TestSimpleConvert - - Key: com.docker.compose.service - Value: simple - Type: AWS::IAM::Role + CloudMap: + Properties: + Description: Service Map for Docker Compose project TestSimpleConvert + Name: TestSimpleConvert.local + Vpc: vpc-123 + Type: AWS::ServiceDiscovery::PrivateDnsNamespace + Cluster: + Properties: + ClusterName: TestSimpleConvert + Tags: + - Key: com.docker.compose.project + Value: TestSimpleConvert + Type: AWS::ECS::Cluster + Default80Ingress: + Properties: + CidrIp: 0.0.0.0/0 + Description: simple:80/tcp on default network + FromPort: 80 + GroupId: + Ref: DefaultNetwork + IpProtocol: TCP + ToPort: 80 + Type: AWS::EC2::SecurityGroupIngress + DefaultNetwork: + Properties: + GroupDescription: TestSimpleConvert Security Group for default network + Tags: + - Key: com.docker.compose.project + Value: TestSimpleConvert + - Key: com.docker.compose.network + Value: TestSimpleConvert_default + VpcId: vpc-123 + Type: AWS::EC2::SecurityGroup + DefaultNetworkIngress: + Properties: + Description: Allow communication within network default + GroupId: + Ref: DefaultNetwork + IpProtocol: "-1" + SourceSecurityGroupId: + Ref: DefaultNetwork + Type: AWS::EC2::SecurityGroupIngress + LoadBalancer: + Properties: + Scheme: internet-facing + SecurityGroups: + - Ref: DefaultNetwork + Subnets: + - subnet1 + - subnet2 + Tags: + - Key: com.docker.compose.project + Value: TestSimpleConvert + Type: application + Type: AWS::ElasticLoadBalancingV2::LoadBalancer + LogGroup: + Properties: + LogGroupName: /docker-compose/TestSimpleConvert + RetentionInDays: 0 + Type: AWS::Logs::LogGroup + SimpleService: + DependsOn: + - SimpleTCP80Listener + Properties: + Cluster: + Fn::GetAtt: + - Cluster + - Arn + DeploymentConfiguration: + MaximumPercent: 200 + MinimumHealthyPercent: 100 + DeploymentController: + Type: ECS + DesiredCount: 1 + LaunchType: FARGATE + LoadBalancers: + - ContainerName: simple + ContainerPort: 80 + TargetGroupArn: + Ref: SimpleTCP80TargetGroup + NetworkConfiguration: + AwsvpcConfiguration: + AssignPublicIp: ENABLED + SecurityGroups: + - Ref: DefaultNetwork + Subnets: + - subnet1 + - subnet2 + PlatformVersion: 1.4.0 + PropagateTags: SERVICE + SchedulingStrategy: REPLICA + ServiceRegistries: + - RegistryArn: + Fn::GetAtt: + - SimpleServiceDiscoveryEntry + - Arn + Tags: + - Key: com.docker.compose.project + Value: TestSimpleConvert + - Key: com.docker.compose.service + Value: simple + TaskDefinition: + Ref: SimpleTaskDefinition + Type: AWS::ECS::Service + SimpleServiceDiscoveryEntry: + Properties: + Description: '"simple" service discovery entry in Cloud Map' + DnsConfig: + DnsRecords: + - TTL: 60 + Type: A + RoutingPolicy: MULTIVALUE + HealthCheckCustomConfig: + FailureThreshold: 1 + Name: simple + NamespaceId: + Ref: CloudMap + Type: AWS::ServiceDiscovery::Service + SimpleTCP80Listener: + Properties: + DefaultActions: + - ForwardConfig: + TargetGroups: + - TargetGroupArn: + Ref: SimpleTCP80TargetGroup + Type: forward + LoadBalancerArn: + Ref: LoadBalancer + Port: 80 + Protocol: HTTP + Type: AWS::ElasticLoadBalancingV2::Listener + SimpleTCP80TargetGroup: + Properties: + Port: 80 + Protocol: HTTP + Tags: + - Key: com.docker.compose.project + Value: TestSimpleConvert + TargetType: ip + VpcId: vpc-123 + Type: AWS::ElasticLoadBalancingV2::TargetGroup + SimpleTaskDefinition: + Properties: + ContainerDefinitions: + - Command: + - .compute.internal + - TestSimpleConvert.local + Essential: false + Image: docker/ecs-searchdomain-sidecar:1.0 + LogConfiguration: + LogDriver: awslogs + Options: + awslogs-group: + Ref: LogGroup + awslogs-region: + Ref: AWS::Region + awslogs-stream-prefix: TestSimpleConvert + Name: Simple_ResolvConf_InitContainer + - DependsOn: + - Condition: SUCCESS + ContainerName: Simple_ResolvConf_InitContainer + DisableNetworking: false + Essential: true + Hostname: "" + Image: nginx + Interactive: false + LinuxParameters: + InitProcessEnabled: false + MaxSwap: 0 + Swappiness: 0 + LogConfiguration: + LogDriver: awslogs + Options: + awslogs-group: + Ref: LogGroup + awslogs-region: + Ref: AWS::Region + awslogs-stream-prefix: TestSimpleConvert + MemoryReservation: 0 + Name: simple + PortMappings: + - ContainerPort: 80 + HostPort: 80 + Protocol: tcp + Privileged: false + PseudoTerminal: false + ReadonlyRootFilesystem: false + StartTimeout: 0 + StopTimeout: 0 + User: "" + WorkingDirectory: "" + Cpu: "256" + ExecutionRoleArn: + Ref: SimpleTaskExecutionRole + Family: TestSimpleConvert-simple + IpcMode: "" + Memory: "512" + NetworkMode: awsvpc + PidMode: "" + RequiresCompatibilities: + - FARGATE + Type: AWS::ECS::TaskDefinition + SimpleTaskExecutionRole: + Properties: + AssumeRolePolicyDocument: + Statement: + - Action: + - sts:AssumeRole + Condition: {} + Effect: Allow + Principal: + Service: ecs-tasks.amazonaws.com + Version: "2012-10-17" + ManagedPolicyArns: + - arn:aws:iam::aws:policy/service-role/AmazonECSTaskExecutionRolePolicy + - arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly + Tags: + - Key: com.docker.compose.project + Value: TestSimpleConvert + - Key: com.docker.compose.service + Value: simple + Type: AWS::IAM::Role diff --git a/ecs/volumes.go b/ecs/volumes.go index 876b825f8..c226886c2 100644 --- a/ecs/volumes.go +++ b/ecs/volumes.go @@ -20,8 +20,8 @@ import ( "context" "fmt" - "github.com/awslabs/goformation/v4/cloudformation" - "github.com/awslabs/goformation/v4/cloudformation/efs" + "github.com/awslabs/goformation/v7/cloudformation" + "github.com/awslabs/goformation/v7/cloudformation/efs" "github.com/compose-spec/compose-go/types" "github.com/docker/compose/v2/pkg/api" "github.com/pkg/errors" @@ -62,16 +62,16 @@ func (b *ecsAPIService) createAccessPoints(project *types.Project, r awsResource ap := efs.AccessPoint{ AccessPointTags: []efs.AccessPoint_AccessPointTag{ { - Key: api.ProjectLabel, - Value: project.Name, + Key: cloudformation.String(api.ProjectLabel), + Value: cloudformation.String(project.Name), }, { - Key: api.VolumeLabel, - Value: name, + Key: cloudformation.String(api.VolumeLabel), + Value: cloudformation.String(name), }, { - Key: "Name", - Value: volume.Name, + Key: cloudformation.String("Name"), + Value: cloudformation.String(volume.Name), }, }, FileSystemId: r.filesystems[name].ID(), @@ -85,7 +85,7 @@ func (b *ecsAPIService) createAccessPoints(project *types.Project, r awsResource } if path != "" { root := efs.AccessPoint_RootDirectory{ - Path: path, + Path: cloudformation.String(path), } ap.RootDirectory = &root if uid != "" { diff --git a/go.mod b/go.mod index a048042e6..8be8322a4 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/Azure/go-autorest/autorest/to v0.4.0 github.com/Microsoft/go-winio v0.6.0 github.com/aws/aws-sdk-go v1.35.33 - github.com/awslabs/goformation/v4 v4.15.6 + github.com/awslabs/goformation/v7 v7.5.0 github.com/buger/goterm v1.0.4 github.com/cnabio/cnab-to-oci v0.3.1-beta1 github.com/compose-spec/compose-go v1.0.8 @@ -44,14 +44,13 @@ require ( github.com/opencontainers/image-spec v1.0.2 github.com/pkg/errors v0.9.1 github.com/prometheus/tsdb v0.10.0 - github.com/sanathkr/go-yaml v0.0.0-20170819195128-ed9d249f429b github.com/sirupsen/logrus v1.9.0 github.com/spf13/cobra v1.6.1 github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.8.1 golang.org/x/oauth2 v0.4.0 golang.org/x/sync v0.1.0 - golang.org/x/sys v0.4.0 + golang.org/x/sys v0.5.0 google.golang.org/grpc v1.52.3 google.golang.org/protobuf v1.28.1 gopkg.in/ini.v1 v1.67.0 @@ -164,6 +163,7 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.1 // indirect github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect + github.com/onsi/ginkgo v1.14.2 // indirect github.com/opencontainers/runc v1.0.2 // indirect github.com/opentracing/opentracing-go v1.2.0 // indirect github.com/oras-project/oras-go v0.1.0 // indirect @@ -177,7 +177,7 @@ require ( github.com/qri-io/jsonschema v0.1.1 // indirect github.com/rubenv/sql-migrate v0.0.0-20200616145509-8d140a17f351 // indirect github.com/russross/blackfriday v1.5.2 // indirect - github.com/sanathkr/yaml v0.0.0-20170819201035-0056894fa522 // indirect + github.com/sanathkr/go-yaml v0.0.0-20170819195128-ed9d249f429b // indirect github.com/shopspring/decimal v1.2.0 // indirect github.com/spf13/cast v1.3.1 // indirect github.com/stretchr/objx v0.5.0 // indirect @@ -194,9 +194,9 @@ require ( go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 // indirect golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 // indirect golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect - golang.org/x/net v0.5.0 // indirect - golang.org/x/term v0.4.0 // indirect - golang.org/x/text v0.6.0 // indirect + golang.org/x/net v0.7.0 // indirect + golang.org/x/term v0.5.0 // indirect + golang.org/x/text v0.7.0 // indirect golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba // indirect golang.org/x/tools v0.1.12 // indirect google.golang.org/appengine v1.6.7 // indirect diff --git a/go.sum b/go.sum index ef01314c7..74d77997b 100644 --- a/go.sum +++ b/go.sum @@ -187,8 +187,8 @@ github.com/aws/aws-sdk-go v1.34.9/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU github.com/aws/aws-sdk-go v1.35.33 h1:8qPRZqCRok5i7VNN51k/Ky7CuyoXMdSs4mUfKyCqvPw= github.com/aws/aws-sdk-go v1.35.33/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= -github.com/awslabs/goformation/v4 v4.15.6 h1:9F0MbtJVSMkuI19G6Fm+qHc1nqScHcOIf+3YRRv+Ohc= -github.com/awslabs/goformation/v4 v4.15.6/go.mod h1:wB5lKZf1J0MYH1Lt4B9w3opqz0uIjP7MMCAcib3QkwA= +github.com/awslabs/goformation/v7 v7.5.0 h1:aYSpn3G6bSSdOle3JZujnq8PozTjEfLOuBAxTEiL6S0= +github.com/awslabs/goformation/v7 v7.5.0/go.mod h1:B9Rb7icuiSSuWItRXK7ydgN8bMxTi4ox0JfxNxhfXBo= github.com/beorn7/perks v0.0.0-20160804104726-4c0e84591b9a/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= @@ -1057,6 +1057,7 @@ github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0 github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.2 h1:8mVmC9kjFFmA8H4pKMUhcblgifdkOIXPvbhN1T36q1M= github.com/onsi/ginkgo v1.14.2/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= +github.com/onsi/ginkgo/v2 v2.3.1 h1:8SbseP7qM32WcvE6VaN6vfXxv698izmsJ1UQX9ve7T8= github.com/onsi/gomega v0.0.0-20151007035656-2152b45fa28a/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= @@ -1065,8 +1066,8 @@ github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1Cpa github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.10.3 h1:gph6h/qe9GSUw1NhH1gp+qb+h8rXD8Cy60Z32Qw3ELA= github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc= +github.com/onsi/gomega v1.22.1 h1:pY8O4lBfsHKZHM/6nrxkhVPUznOlIu3quZcKP/M20KI= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opencontainers/go-digest v0.0.0-20170106003457-a6d0ee40d420/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= @@ -1208,8 +1209,6 @@ github.com/safchain/ethtool v0.0.0-20190326074333-42ed695e3de8/go.mod h1:Z0q5wiB github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= github.com/sanathkr/go-yaml v0.0.0-20170819195128-ed9d249f429b h1:jUK33OXuZP/l6babJtnLo1qsGvq6G9so9KMflGAm4YA= github.com/sanathkr/go-yaml v0.0.0-20170819195128-ed9d249f429b/go.mod h1:8458kAagoME2+LN5//WxE71ysZ3B7r22fdgb7qVmXSY= -github.com/sanathkr/yaml v0.0.0-20170819201035-0056894fa522 h1:fOCp11H0yuyAt2wqlbJtbyPzSgaxHTv8uN1pMpkG1t8= -github.com/sanathkr/yaml v0.0.0-20170819201035-0056894fa522/go.mod h1:tQTYKOQgxoH3v6dEmdHiz4JG+nbxWwM5fgPQUpSZqVQ= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvWlF4P2Ca7zGrPiEpWo= @@ -1342,7 +1341,6 @@ github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb/go.mod h1:N2 github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0= github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= github.com/xeipuuv/gojsonschema v0.0.0-20180618132009-1d523034197f/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs= -github.com/xeipuuv/gojsonschema v0.0.0-20181112162635-ac52e6811b56/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs= github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74= github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= @@ -1532,8 +1530,8 @@ golang.org/x/net v0.0.0-20210224082022-3d97a244fca7/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.5.0 h1:GyT4nK/YDHSqa1c4753ouYCDajOYKTja9Xb/OHtgvSw= -golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= +golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= +golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/oauth2 v0.0.0-20180724155351-3d292e4d0cdc/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1664,14 +1662,14 @@ golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211103235746-7861aae1554b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220422013727-9388b58f7150/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.4.0 h1:Zr2JFtRQNX3BCZ8YtxRE9hNJYC8J6I1MVbMg6owUp18= -golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210503060354-a79de5458b56/go.mod h1:tfny5GFUkzUvx4ps4ajbZsCe5lw1metzhBm9T3x7oIY= -golang.org/x/term v0.4.0 h1:O7UWfv5+A2qiuulQk30kVinPoMtoIPeVaKLEgLpVkvg= -golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= +golang.org/x/term v0.5.0 h1:n2a8QNdAb0sZNpU9R1ALUXBbY+w51fCQDN+7EdxNBsY= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1680,8 +1678,8 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.6.0 h1:3XmdazWV+ubf7QgHSTWeykHOci5oeekaGJBLkrkaw4k= -golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1761,7 +1759,6 @@ golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/api v0.0.0-20160322025152-9bf6e6e569ff/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk=