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

aws.appsync.Function defaults to generating an invalid function name #781

Closed
alexmcmanus opened this issue Oct 27, 2019 · 0 comments · Fixed by #802
Closed

aws.appsync.Function defaults to generating an invalid function name #781

alexmcmanus opened this issue Oct 27, 2019 · 0 comments · Fixed by #802
Assignees

Comments

@alexmcmanus
Copy link

Pulumi generates a name argument for most resources by appending a unique suffix to the resource name. E.g.

const lookupInputBusinessId = new aws.appsync.Function('lookupInputBusinessId', ...)

...will generate a function name like lookupInputBusinessId-058765e. Unfortunately, - is not a legal character for a function name.

Pulumi -> Terraform -> AWS happily lets you create a function with an illegal name however. After creating it, the AWS console won't let you edit the function, reporting that the name is illegal. And even more strangely, if you then try and modify the function and update via Pulumi, it leads to the following error:

BadRequestException: Invalid Function name given, must match pattern [_A-Za-z][_0-9A-Za-z]*

Note that appsync function names do not need to be unique - the functionId is used to reference the function and not the name. So I think that adding the unique suffix is unnecessary in this case.

There is a simple workaround: explicitly specify the name in the Pulumi config:

const lookupInputBusinessId = new aws.appsync.Function('lookupInputBusinessId', {
  name: 'lookupInputBusinessId',
  ...
})
stack72 added a commit that referenced this issue Nov 22, 2019
Fixes: #781

Before this change, the autogeneration was giving the following
message

```
RequestException: Invalid Function name given, must match pattern [_A-Za-z][_0-9A-Za-z
```
stack72 added a commit that referenced this issue Nov 25, 2019
Fixes: #781

Before this change, the autogeneration was giving the following
message

```
RequestException: Invalid Function name given, must match pattern [_A-Za-z][_0-9A-Za-z
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants