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.
157 lines (129 loc) • 4.61 kB
HTML
<!--
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 ResourceGroupsTaggingAPI">
<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="DescribeReportCreation">DescribeReportCreation</option>
<option value="GetComplianceSummary">GetComplianceSummary</option>
<option value="GetResources">GetResources</option>
<option value="GetTagKeys">GetTagKeys</option>
<option value="GetTagValues">GetTagValues</option>
<option value="StartReportCreation">StartReportCreation</option>
<option value="TagResources">TagResources</option>
<option value="UntagResources">UntagResources</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='KeyAttr' class='hiddenAttrs'>
<label for="node-input-Key"><i class="fa fa-tag"></i>Key</label>
<input type="text" id="node-input-Key" placeholder="Key"></input>
</div>
<div class="form-row" id='S3BucketAttr' class='hiddenAttrs'>
<label for="node-input-S3Bucket"><i class="fa fa-tag"></i>S3Bucket</label>
<input type="text" id="node-input-S3Bucket" placeholder="S3Bucket"></input>
</div>
<div class="form-row" id='ResourceARNListAttr' class='hiddenAttrs'>
<label for="node-input-ResourceARNList"><i class="fa fa-tag"></i>ResourceARNList</label>
<input type="text" id="node-input-ResourceARNList" placeholder="ResourceARNList"></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>
<script>
var nodeOps={
DescribeReportCreation:[
],
GetComplianceSummary:[
],
GetResources:[
],
GetTagKeys:[
],
GetTagValues:[
'#KeyAttr'
],
StartReportCreation:[
'#S3BucketAttr'
],
TagResources:[
'#ResourceARNListAttr','#TagsAttr'
],
UntagResources:[
'#ResourceARNListAttr','#TagKeysAttr'
]
};
$('#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 ResourceGroupsTaggingAPI">
<p>
AWS AWS Resource Groups Tagging API
</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 ResourceGroupsTaggingAPI',{
category: 'AWS',
color:"#C0DEED",
defaults: {
aws: {type:"amazon config",required:true},
operation: { value: 'DescribeReportCreation' },
Key: { value: ""} ,
S3Bucket: { value: ""} ,
ResourceARNList: { value: ""} ,
Tags: { value: ""} ,
TagKeys: { value: ""} ,
name: { value: "" }
},
inputs:1,
outputs: 2,
outputLabels: ["data","err"],
icon: "aws.png",
align: "right",
label: function() {
return this.name || "ResourceGroupsTaggingAPI " + this.operation;
},
oneditprepare: function () {
}
});
</script>