(apiName string, initialDeploymentTime int64, tags map[string]string)
| 28 | ) |
| 29 | |
| 30 | func createFIFOQueue(apiName string, initialDeploymentTime int64, tags map[string]string) (string, error) { |
| 31 | for key, value := range config.ClusterConfig.Tags { |
| 32 | tags[key] = value |
| 33 | } |
| 34 | |
| 35 | queueName := apiQueueName(apiName, initialDeploymentTime) |
| 36 | |
| 37 | attributes := map[string]string{ |
| 38 | sqs.QueueAttributeNameFifoQueue: "true", |
| 39 | sqs.QueueAttributeNameVisibilityTimeout: "60", |
| 40 | } |
| 41 | |
| 42 | output, err := config.AWS.SQS().CreateQueue( |
| 43 | &sqs.CreateQueueInput{ |
| 44 | Attributes: aws.StringMap(attributes), |
| 45 | QueueName: aws.String(queueName), |
| 46 | Tags: aws.StringMap(tags), |
| 47 | }, |
| 48 | ) |
| 49 | if err != nil { |
| 50 | return "", errors.Wrap(err, "failed to create sqs queue", queueName) |
| 51 | } |
| 52 | |
| 53 | return *output.QueueUrl, nil |
| 54 | } |
| 55 | |
| 56 | func apiQueueName(apiName string, initialDeploymentTime int64) string { |
| 57 | // initialDeploymentTime is incorporated so that the queue name changes when doing a deploy after a delete |
no test coverage detected