more feedback

This commit is contained in:
Ciprian Hacman 2021-10-25 06:15:49 +03:00
parent 95441e7c36
commit c0dfd17885
1 changed files with 4 additions and 6 deletions

View File

@ -50,7 +50,7 @@ type SQS struct {
var _ fi.CompareWithID = &SQS{}
func (q *SQS) CompareWithID() *string {
return q.URL
return q.ARN
}
func (q *SQS) Find(c *fi.Context) (*SQS, error) {
@ -130,7 +130,7 @@ func (q *SQS) Find(c *fi.Context) (*SQS, error) {
}
//Avoid flapping
q.Name = actual.Name
q.ARN = actual.ARN
return actual, nil
}
@ -173,17 +173,15 @@ func (q *SQS) RenderAWS(t *awsup.AWSAPITarget, a, e, changes *SQS) error {
return fmt.Errorf("error creating SQS queue: %v", err)
}
url := response.QueueUrl
attributes, err := t.Cloud.SQS().GetQueueAttributes(&sqs.GetQueueAttributesInput{
AttributeNames: []*string{s("QueueArn")},
QueueUrl: url,
QueueUrl: response.QueueUrl,
})
if err != nil {
return fmt.Errorf("error getting SQS queue attributes: %v", err)
}
e.ARN = attributes.Attributes["QueueArn"]
e.URL = url
}
return nil