Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support autonaming of SQS fifo queues #967

Closed
rofr opened this issue May 11, 2020 · 4 comments · Fixed by #1257 or #1398
Closed

Support autonaming of SQS fifo queues #967

rofr opened this issue May 11, 2020 · 4 comments · Fixed by #1257 or #1398
Assignees
Labels
kind/enhancement Improvements or new features resolution/fixed This issue was fixed

Comments

@rofr
Copy link

rofr commented May 11, 2020

SQS FIFO queue names must have a ".fifo" suffix. This does not play well will auto-naming because the random hex will be tacked on at the end yielding an invalid name. I suggest that the ".fifo" suffix should be added by pulumi when autonaming a fifo queue.

Here is some example C# code:

    // fails on AWS because name must end with .fifo
    var q1 = new Queue("myqueue", new QueueArgs {
        FifoQueue = true
    });

    //fails in pulumi with the message:
    //only alphanumeric characters and hyphens allowed in "name"
    var q2 = new Queue("myqueue.fifo", new QueueArgs {
        FifoQueue = true
   });

   //explicitly assigning a name works but does not use autonaming 
   var q3 = new Queue("myqueue" new QueueArgs {
        FifoQueue = true,
        Name = "myqueue.fifo"
    });
@clstokes
Copy link

Related:

@stack72 stack72 added the kind/enhancement Improvements or new features label May 24, 2020
lukehoban pushed a commit to pulumi/pulumi-terraform-bridge that referenced this issue Nov 15, 2020
lukehoban pushed a commit to pulumi/pulumi-terraform-bridge that referenced this issue Nov 15, 2020
lukehoban pushed a commit that referenced this issue Nov 15, 2020
@lukehoban lukehoban self-assigned this Nov 15, 2020
stack72 pushed a commit to pulumi/pulumi-terraform-bridge that referenced this issue Nov 18, 2020
* Add richer name transformation support

Part of pulumi/pulumi-aws#967.

* Additional test case
@clstokes
Copy link

This appears to have regressed. Full repro at https://gist.github.com/c3f571b0af3b891b3b8283cbf58ecb9c.

import * as aws from "@pulumi/aws";

// FAILS - name becomes `main-abc123` - Error validating the FIFO queue name: [FIFO queue name should end with ".fifo": main-4d1963b]
const main = new aws.sqs.Queue("main", {
    fifoQueue: true,
});

// FAILS - name becomes `main.fifo-abc123` - resource 'main.fifo' has a problem: only alphanumeric characters and hyphens allowed in "name"
const mainFifo = new aws.sqs.Queue("main.fifo", {
    fifoQueue: true,
});

// SUCCEEDS - name stays `main.fifo`
const mainFifoName = new aws.sqs.Queue("main", {
    name: "main.fifo",
    fifoQueue: true,
});
p-ts-aws-sqs-fifo@ /Users/clstokes/cc/customers/mbo/p-ts-aws-sqs-fifo
├── @pulumi/aws@3.32.1
├── @pulumi/awsx@0.24.0
├── @pulumi/pulumi@2.22.0
└── @types/node@10.17.55

p-ts-aws-sqs-fifo % pulumi version
v2.22.0

@clstokes clstokes reopened this Mar 12, 2021
@clstokes clstokes assigned stack72 and unassigned lukehoban Mar 12, 2021
@leezen
Copy link
Contributor

leezen commented Mar 13, 2021

@stack72 The property in the PR that fixes this is fifo but the underlying property seems like it should be fifo_queue? Am I missing something?

stack72 added a commit that referenced this issue Mar 13, 2021
Fixes: #967

```
▶ pulumi up
.....
     Type                 Name                  Status
 +   pulumi:pulumi:Stack  testing-aws-fifo-dev  created
 +   └─ aws:sqs:Queue     main2                 created

Outputs:
    name: "main2-801295a.fifo"

Resources:
    + 2 created

Duration: 8s
```
stack72 added a commit that referenced this issue Mar 13, 2021
Fixes: #967

```
▶ pulumi up
.....
     Type                 Name                  Status
 +   pulumi:pulumi:Stack  testing-aws-fifo-dev  created
 +   └─ aws:sqs:Queue     main2                 created

Outputs:
    name: "main2-801295a.fifo"

Resources:
    + 2 created

Duration: 8s
```
@stack72
Copy link
Contributor

stack72 commented Mar 13, 2021

@leezen great question - this actually uses our property bag that gets translated from the TF provider - I think this regressed around the time we changed to use v2 of the plugin sdk as the properties changed around

Regardless, it was a lift and shift of a PR that Luke created that actually worked originally

PR is open - it's been approved and tests have been added to ensure we don't regress again!

I will publish a patch as soon as this goes green

stack72 added a commit that referenced this issue Mar 13, 2021
Fixes: #967

```
▶ pulumi up
.....
     Type                 Name                  Status
 +   pulumi:pulumi:Stack  testing-aws-fifo-dev  created
 +   └─ aws:sqs:Queue     main2                 created

Outputs:
    name: "main2-801295a.fifo"

Resources:
    + 2 created

Duration: 8s
```
stack72 added a commit that referenced this issue Mar 13, 2021
Fixes: #967

```
▶ pulumi up
.....
     Type                 Name                  Status
 +   pulumi:pulumi:Stack  testing-aws-fifo-dev  created
 +   └─ aws:sqs:Queue     main2                 created

Outputs:
    name: "main2-801295a.fifo"

Resources:
    + 2 created

Duration: 8s
```
stack72 added a commit that referenced this issue Mar 13, 2021
Fixes: #967

```
▶ pulumi up
.....
     Type                 Name                  Status
 +   pulumi:pulumi:Stack  testing-aws-fifo-dev  created
 +   └─ aws:sqs:Queue     main2                 created

Outputs:
    name: "main2-801295a.fifo"

Resources:
    + 2 created

Duration: 8s
```
@pulumi-bot pulumi-bot added the resolution/fixed This issue was fixed label Mar 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Improvements or new features resolution/fixed This issue was fixed
Projects
None yet
6 participants