Closed
Description
Creating a custom resource type fails with the error __init__() got an unexpected keyword argument 'snapshotRequested' (TypeError)
Here is how my python versions look and how the custom resource type is created.
% python -V
Python 3.6.12
% pip list | grep cloudformation
cloudformation-cli 0.1.12
cloudformation-cli-go-plugin 2.0.2
cloudformation-cli-java-plugin 2.0.2
cloudformation-cli-python-lib 2.1.2
cloudformation-cli-python-plugin 2.1.1
Then deploying a custom resource as cfn init
configures it
% cfn init
Initializing new project
What's the name of your resource type?
(Organization::Service::Resource)
>> MyOrg::Dataprovider::Variable
Select a language for code generation:
[1] go
[2] java
[3] python36
[4] python37
(enter an integer):
>> 3
Use docker for platform-independent packaging (Y/n)?
This is highly recommended unless you are experienced
with cross-platform Python packaging.
>> Y
Initialized a new project in /Users/.../cfn-resource
% cfn generate
Generated files for MyOrg::Dataprovider::Variable
% cfn submit --set-default
Starting Docker build. This may take several minutes if the image 'lambci/lambda:build-python3.6' needs to be pulled first.
Successfully submitted type. Waiting for registration with token '7c37bc66-65a7-41db-b4c6-444c9758c3ce' to complete.
Registration complete.
{'ProgressStatus': 'COMPLETE', 'Description': 'Deployment is currently in DEPLOY_STAGE of status COMPLETED; ', 'TypeArn': 'arn:aws:cloudformation:eu-central-1:112233445566:type/resource/MyOrg-Dataprovider-Variable', 'TypeVersionArn': 'arn:aws:cloudformation:eu-central-1:112233445566:type/resource/MyOrg-Dataprovider-Variable/00000006', 'ResponseMetadata': {'RequestId': '1171feb8-fc07-421b-ac6d-ed8ee361d15c', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '1171feb8-fc07-421b-ac6d-ed8ee361d15c', 'content-type': 'text/xml', 'content-length': '707', 'date': 'Sun, 01 Nov 2020 13:33:04 GMT'}, 'RetryAttempts': 0}}
Set default version to 'arn:aws:cloudformation:eu-central-1:112233445566:type/resource/MyOrg-Dataprovider-Variable/00000006
So far all worked. but when trying to use the resource type in template
AWSTemplateFormatVersion: 2010-09-09
Description: Sample template for MyOrg::Dataprovider::Variable usage
Resources:
SampleVariable:
Type: MyOrg::Dataprovider::Variable
Properties:
Title: "Hello12345678901234567890"
TestCode: "NOT_STARTED"
Outputs:
Variable:
Description: Variable ID
Value: !Ref SampleVariable
Create of SampleVariable
fails with the error
__init__() got an unexpected keyword argument 'snapshotRequested' (TypeError)
Did I forget something?
Am I missing something from my requirements.txt
? Now it has only
cloudformation-cli-python-lib==2.1.2
Metadata
Metadata
Assignees
Labels
No labels