UNPKG

node-red-contrib-aws

Version:

A collection of Node-RED nodes for AWS. Includes nodes for DynamoDB, EC2, IoT, Kinesis, Lambda, SNS, SQS and S3.

462 lines (394 loc) 15.9 kB
<!-- Copyright 2021 Daniel Thomas. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <script type="text/x-red" data-template-name="AWS KMS"> <style scoped> .hiddenAttrs {display:none;} .visibleAttrs {display:block;} </style> <div class="form-row"> <label for="node-input-aws"><i class="fa fa-user"></i> AWS</label> <input type="text" id="node-input-aws"> </div> <div class="form-row"> <label for="node-input-operation"><i class="fa fa-wrench"></i> Operation</label> <select type="text" id="node-input-operation"> <option value="CancelKeyDeletion">CancelKeyDeletion</option> <option value="ConnectCustomKeyStore">ConnectCustomKeyStore</option> <option value="CreateAlias">CreateAlias</option> <option value="CreateCustomKeyStore">CreateCustomKeyStore</option> <option value="CreateGrant">CreateGrant</option> <option value="CreateKey">CreateKey</option> <option value="Decrypt">Decrypt</option> <option value="DeleteAlias">DeleteAlias</option> <option value="DeleteCustomKeyStore">DeleteCustomKeyStore</option> <option value="DeleteImportedKeyMaterial">DeleteImportedKeyMaterial</option> <option value="DescribeCustomKeyStores">DescribeCustomKeyStores</option> <option value="DescribeKey">DescribeKey</option> <option value="DisableKey">DisableKey</option> <option value="DisableKeyRotation">DisableKeyRotation</option> <option value="DisconnectCustomKeyStore">DisconnectCustomKeyStore</option> <option value="EnableKey">EnableKey</option> <option value="EnableKeyRotation">EnableKeyRotation</option> <option value="Encrypt">Encrypt</option> <option value="GenerateDataKey">GenerateDataKey</option> <option value="GenerateDataKeyPair">GenerateDataKeyPair</option> <option value="GenerateDataKeyPairWithoutPlaintext">GenerateDataKeyPairWithoutPlaintext</option> <option value="GenerateDataKeyWithoutPlaintext">GenerateDataKeyWithoutPlaintext</option> <option value="GenerateRandom">GenerateRandom</option> <option value="GetKeyPolicy">GetKeyPolicy</option> <option value="GetKeyRotationStatus">GetKeyRotationStatus</option> <option value="GetParametersForImport">GetParametersForImport</option> <option value="GetPublicKey">GetPublicKey</option> <option value="ImportKeyMaterial">ImportKeyMaterial</option> <option value="ListAliases">ListAliases</option> <option value="ListGrants">ListGrants</option> <option value="ListKeyPolicies">ListKeyPolicies</option> <option value="ListKeys">ListKeys</option> <option value="ListResourceTags">ListResourceTags</option> <option value="ListRetirableGrants">ListRetirableGrants</option> <option value="PutKeyPolicy">PutKeyPolicy</option> <option value="ReEncrypt">ReEncrypt</option> <option value="RetireGrant">RetireGrant</option> <option value="RevokeGrant">RevokeGrant</option> <option value="ScheduleKeyDeletion">ScheduleKeyDeletion</option> <option value="Sign">Sign</option> <option value="TagResource">TagResource</option> <option value="UntagResource">UntagResource</option> <option value="UpdateAlias">UpdateAlias</option> <option value="UpdateCustomKeyStore">UpdateCustomKeyStore</option> <option value="UpdateKeyDescription">UpdateKeyDescription</option> <option value="Verify">Verify</option> ; </select> </div> <div class="form-row"> <label for="node-input-name"><i class="fa fa-tag"></i>Name</label> <input type="text" id="node-input-name" placeholder="Name"></input> </div> <hr/> <div id="AttrHolder"> <div class="form-row" id='KeyIdAttr' class='hiddenAttrs'> <label for="node-input-KeyId"><i class="fa fa-tag"></i>KeyId</label> <input type="text" id="node-input-KeyId" placeholder="KeyId"></input> </div> <div class="form-row" id='CustomKeyStoreIdAttr' class='hiddenAttrs'> <label for="node-input-CustomKeyStoreId"><i class="fa fa-tag"></i>CustomKeyStoreId</label> <input type="text" id="node-input-CustomKeyStoreId" placeholder="CustomKeyStoreId"></input> </div> <div class="form-row" id='AliasNameAttr' class='hiddenAttrs'> <label for="node-input-AliasName"><i class="fa fa-tag"></i>AliasName</label> <input type="text" id="node-input-AliasName" placeholder="AliasName"></input> </div> <div class="form-row" id='TargetKeyIdAttr' class='hiddenAttrs'> <label for="node-input-TargetKeyId"><i class="fa fa-tag"></i>TargetKeyId</label> <input type="text" id="node-input-TargetKeyId" placeholder="TargetKeyId"></input> </div> <div class="form-row" id='CustomKeyStoreNameAttr' class='hiddenAttrs'> <label for="node-input-CustomKeyStoreName"><i class="fa fa-tag"></i>CustomKeyStoreName</label> <input type="text" id="node-input-CustomKeyStoreName" placeholder="CustomKeyStoreName"></input> </div> <div class="form-row" id='CloudHsmClusterIdAttr' class='hiddenAttrs'> <label for="node-input-CloudHsmClusterId"><i class="fa fa-tag"></i>CloudHsmClusterId</label> <input type="text" id="node-input-CloudHsmClusterId" placeholder="CloudHsmClusterId"></input> </div> <div class="form-row" id='TrustAnchorCertificateAttr' class='hiddenAttrs'> <label for="node-input-TrustAnchorCertificate"><i class="fa fa-tag"></i>TrustAnchorCertificate</label> <input type="text" id="node-input-TrustAnchorCertificate" placeholder="TrustAnchorCertificate"></input> </div> <div class="form-row" id='KeyStorePasswordAttr' class='hiddenAttrs'> <label for="node-input-KeyStorePassword"><i class="fa fa-tag"></i>KeyStorePassword</label> <input type="text" id="node-input-KeyStorePassword" placeholder="KeyStorePassword"></input> </div> <div class="form-row" id='GranteePrincipalAttr' class='hiddenAttrs'> <label for="node-input-GranteePrincipal"><i class="fa fa-tag"></i>GranteePrincipal</label> <input type="text" id="node-input-GranteePrincipal" placeholder="GranteePrincipal"></input> </div> <div class="form-row" id='OperationsAttr' class='hiddenAttrs'> <label for="node-input-Operations"><i class="fa fa-tag"></i>Operations</label> <input type="text" id="node-input-Operations" placeholder="Operations"></input> </div> <div class="form-row" id='CiphertextBlobAttr' class='hiddenAttrs'> <label for="node-input-CiphertextBlob"><i class="fa fa-tag"></i>CiphertextBlob</label> <input type="text" id="node-input-CiphertextBlob" placeholder="CiphertextBlob"></input> </div> <div class="form-row" id='PlaintextAttr' class='hiddenAttrs'> <label for="node-input-Plaintext"><i class="fa fa-tag"></i>Plaintext</label> <input type="text" id="node-input-Plaintext" placeholder="Plaintext"></input> </div> <div class="form-row" id='KeyPairSpecAttr' class='hiddenAttrs'> <label for="node-input-KeyPairSpec"><i class="fa fa-tag"></i>KeyPairSpec</label> <input type="text" id="node-input-KeyPairSpec" placeholder="KeyPairSpec"></input> </div> <div class="form-row" id='PolicyNameAttr' class='hiddenAttrs'> <label for="node-input-PolicyName"><i class="fa fa-tag"></i>PolicyName</label> <input type="text" id="node-input-PolicyName" placeholder="PolicyName"></input> </div> <div class="form-row" id='WrappingAlgorithmAttr' class='hiddenAttrs'> <label for="node-input-WrappingAlgorithm"><i class="fa fa-tag"></i>WrappingAlgorithm</label> <input type="text" id="node-input-WrappingAlgorithm" placeholder="WrappingAlgorithm"></input> </div> <div class="form-row" id='WrappingKeySpecAttr' class='hiddenAttrs'> <label for="node-input-WrappingKeySpec"><i class="fa fa-tag"></i>WrappingKeySpec</label> <input type="text" id="node-input-WrappingKeySpec" placeholder="WrappingKeySpec"></input> </div> <div class="form-row" id='ImportTokenAttr' class='hiddenAttrs'> <label for="node-input-ImportToken"><i class="fa fa-tag"></i>ImportToken</label> <input type="text" id="node-input-ImportToken" placeholder="ImportToken"></input> </div> <div class="form-row" id='EncryptedKeyMaterialAttr' class='hiddenAttrs'> <label for="node-input-EncryptedKeyMaterial"><i class="fa fa-tag"></i>EncryptedKeyMaterial</label> <input type="text" id="node-input-EncryptedKeyMaterial" placeholder="EncryptedKeyMaterial"></input> </div> <div class="form-row" id='RetiringPrincipalAttr' class='hiddenAttrs'> <label for="node-input-RetiringPrincipal"><i class="fa fa-tag"></i>RetiringPrincipal</label> <input type="text" id="node-input-RetiringPrincipal" placeholder="RetiringPrincipal"></input> </div> <div class="form-row" id='PolicyAttr' class='hiddenAttrs'> <label for="node-input-Policy"><i class="fa fa-tag"></i>Policy</label> <input type="text" id="node-input-Policy" placeholder="Policy"></input> </div> <div class="form-row" id='DestinationKeyIdAttr' class='hiddenAttrs'> <label for="node-input-DestinationKeyId"><i class="fa fa-tag"></i>DestinationKeyId</label> <input type="text" id="node-input-DestinationKeyId" placeholder="DestinationKeyId"></input> </div> <div class="form-row" id='GrantIdAttr' class='hiddenAttrs'> <label for="node-input-GrantId"><i class="fa fa-tag"></i>GrantId</label> <input type="text" id="node-input-GrantId" placeholder="GrantId"></input> </div> <div class="form-row" id='MessageAttr' class='hiddenAttrs'> <label for="node-input-Message"><i class="fa fa-tag"></i>Message</label> <input type="text" id="node-input-Message" placeholder="Message"></input> </div> <div class="form-row" id='SigningAlgorithmAttr' class='hiddenAttrs'> <label for="node-input-SigningAlgorithm"><i class="fa fa-tag"></i>SigningAlgorithm</label> <input type="text" id="node-input-SigningAlgorithm" placeholder="SigningAlgorithm"></input> </div> <div class="form-row" id='TagsAttr' class='hiddenAttrs'> <label for="node-input-Tags"><i class="fa fa-tag"></i>Tags</label> <input type="text" id="node-input-Tags" placeholder="Tags"></input> </div> <div class="form-row" id='TagKeysAttr' class='hiddenAttrs'> <label for="node-input-TagKeys"><i class="fa fa-tag"></i>TagKeys</label> <input type="text" id="node-input-TagKeys" placeholder="TagKeys"></input> </div> <div class="form-row" id='DescriptionAttr' class='hiddenAttrs'> <label for="node-input-Description"><i class="fa fa-tag"></i>Description</label> <input type="text" id="node-input-Description" placeholder="Description"></input> </div> <div class="form-row" id='SignatureAttr' class='hiddenAttrs'> <label for="node-input-Signature"><i class="fa fa-tag"></i>Signature</label> <input type="text" id="node-input-Signature" placeholder="Signature"></input> </div> </div> <script> var nodeOps={ CancelKeyDeletion:[ '#KeyIdAttr' ], ConnectCustomKeyStore:[ '#CustomKeyStoreIdAttr' ], CreateAlias:[ '#AliasNameAttr','#TargetKeyIdAttr' ], CreateCustomKeyStore:[ '#CustomKeyStoreNameAttr','#CloudHsmClusterIdAttr','#TrustAnchorCertificateAttr','#KeyStorePasswordAttr' ], CreateGrant:[ '#KeyIdAttr','#GranteePrincipalAttr','#OperationsAttr' ], CreateKey:[ ], Decrypt:[ '#CiphertextBlobAttr' ], DeleteAlias:[ '#AliasNameAttr' ], DeleteCustomKeyStore:[ '#CustomKeyStoreIdAttr' ], DeleteImportedKeyMaterial:[ '#KeyIdAttr' ], DescribeCustomKeyStores:[ ], DescribeKey:[ '#KeyIdAttr' ], DisableKey:[ '#KeyIdAttr' ], DisableKeyRotation:[ '#KeyIdAttr' ], DisconnectCustomKeyStore:[ '#CustomKeyStoreIdAttr' ], EnableKey:[ '#KeyIdAttr' ], EnableKeyRotation:[ '#KeyIdAttr' ], Encrypt:[ '#KeyIdAttr','#PlaintextAttr' ], GenerateDataKey:[ '#KeyIdAttr' ], GenerateDataKeyPair:[ '#KeyIdAttr','#KeyPairSpecAttr' ], GenerateDataKeyPairWithoutPlaintext:[ '#KeyIdAttr','#KeyPairSpecAttr' ], GenerateDataKeyWithoutPlaintext:[ '#KeyIdAttr' ], GenerateRandom:[ ], GetKeyPolicy:[ '#KeyIdAttr','#PolicyNameAttr' ], GetKeyRotationStatus:[ '#KeyIdAttr' ], GetParametersForImport:[ '#KeyIdAttr','#WrappingAlgorithmAttr','#WrappingKeySpecAttr' ], GetPublicKey:[ '#KeyIdAttr' ], ImportKeyMaterial:[ '#KeyIdAttr','#ImportTokenAttr','#EncryptedKeyMaterialAttr' ], ListAliases:[ ], ListGrants:[ '#KeyIdAttr' ], ListKeyPolicies:[ '#KeyIdAttr' ], ListKeys:[ ], ListResourceTags:[ '#KeyIdAttr' ], ListRetirableGrants:[ '#RetiringPrincipalAttr' ], PutKeyPolicy:[ '#KeyIdAttr','#PolicyNameAttr','#PolicyAttr' ], ReEncrypt:[ '#CiphertextBlobAttr','#DestinationKeyIdAttr' ], RetireGrant:[ ], RevokeGrant:[ '#KeyIdAttr','#GrantIdAttr' ], ScheduleKeyDeletion:[ '#KeyIdAttr' ], Sign:[ '#KeyIdAttr','#MessageAttr','#SigningAlgorithmAttr' ], TagResource:[ '#KeyIdAttr','#TagsAttr' ], UntagResource:[ '#KeyIdAttr','#TagKeysAttr' ], UpdateAlias:[ '#AliasNameAttr','#TargetKeyIdAttr' ], UpdateCustomKeyStore:[ '#CustomKeyStoreIdAttr' ], UpdateKeyDescription:[ '#KeyIdAttr','#DescriptionAttr' ], Verify:[ '#KeyIdAttr','#MessageAttr','#SignatureAttr','#SigningAlgorithmAttr' ] }; $('#node-input-operation').on('change',function(){ $('#AttrHolder').children().addClass('hiddenAttrs').removeClass('visibleAttrs'); if (nodeOps[this.value]) $(nodeOps[this.value].join()).addClass('visibleAttrs').removeClass('hiddenAttrs'); }); </script> </script> <script type="text/x-red" data-help-name="amazon KMS"> <p> AWS AWS Key Management Service </p> <p> <b>Descriptions to be added</b< </p> <p> NOTE: Parameters must be specified in the message, using the case specified in the AWS API documentation (normally UpperCaseLeading).. </p> </script> <script type="text/javascript"> RED.nodes.registerType('AWS KMS',{ category: 'AWS', color:"#C0DEED", defaults: { aws: {type:"amazon config",required:true}, operation: { value: 'CancelKeyDeletion' }, KeyId: { value: ""} , CustomKeyStoreId: { value: ""} , AliasName: { value: ""} , TargetKeyId: { value: ""} , CustomKeyStoreName: { value: ""} , CloudHsmClusterId: { value: ""} , TrustAnchorCertificate: { value: ""} , KeyStorePassword: { value: ""} , GranteePrincipal: { value: ""} , Operations: { value: ""} , CiphertextBlob: { value: ""} , Plaintext: { value: ""} , KeyPairSpec: { value: ""} , PolicyName: { value: ""} , WrappingAlgorithm: { value: ""} , WrappingKeySpec: { value: ""} , ImportToken: { value: ""} , EncryptedKeyMaterial: { value: ""} , RetiringPrincipal: { value: ""} , Policy: { value: ""} , DestinationKeyId: { value: ""} , GrantId: { value: ""} , Message: { value: ""} , SigningAlgorithm: { value: ""} , Tags: { value: ""} , TagKeys: { value: ""} , Description: { value: ""} , Signature: { value: ""} , name: { value: "" } }, inputs:1, outputs: 2, outputLabels: ["data","err"], icon: "aws.png", align: "right", label: function() { return this.name || "KMS " + this.operation; }, oneditprepare: function () { } }); </script>