mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-23 10:32:17 -08:00
feat(AWS Elastic Load Balancer Node): add Elastic Load Balancer node (#4264)
* ✨ AWS Elastic Load Balancer * Added codex file for ELB * ⚡ Add paired items Co-authored-by: Jonathan Bennetts <jonathan.bennetts@gmail.com>
This commit is contained in:
parent
a14110e663
commit
fac6efbb41
18
packages/nodes-base/nodes/Aws/ELB/AwsElb.node.json
Normal file
18
packages/nodes-base/nodes/Aws/ELB/AwsElb.node.json
Normal file
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"node": "n8n-nodes-base.awsElb",
|
||||
"nodeVersion": "1.0",
|
||||
"codexVersion": "1.0",
|
||||
"categories": ["Development"],
|
||||
"resources": {
|
||||
"credentialDocumentation": [
|
||||
{
|
||||
"url": "https://docs.n8n.io/credentials/aws"
|
||||
}
|
||||
],
|
||||
"primaryDocumentation": [
|
||||
{
|
||||
"url": "https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.awsElb/"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
463
packages/nodes-base/nodes/Aws/ELB/AwsElb.node.ts
Normal file
463
packages/nodes-base/nodes/Aws/ELB/AwsElb.node.ts
Normal file
|
@ -0,0 +1,463 @@
|
|||
import { IExecuteFunctions } from 'n8n-core';
|
||||
|
||||
import {
|
||||
IDataObject,
|
||||
ILoadOptionsFunctions,
|
||||
INodeExecutionData,
|
||||
INodePropertyOptions,
|
||||
INodeType,
|
||||
INodeTypeDescription,
|
||||
JsonObject,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
import { awsApiRequestSOAP, awsApiRequestSOAPAllItems } from './GenericFunctions';
|
||||
|
||||
import { loadBalancerFields, loadBalancerOperations } from './LoadBalancerDescription';
|
||||
|
||||
import {
|
||||
listenerCertificateFields,
|
||||
listenerCertificateOperations,
|
||||
} from './ListenerCertificateDescription';
|
||||
|
||||
export class AwsElb implements INodeType {
|
||||
description: INodeTypeDescription = {
|
||||
displayName: 'AWS ELB',
|
||||
name: 'awsElb',
|
||||
icon: 'file:elb.svg',
|
||||
group: ['output'],
|
||||
version: 1,
|
||||
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
||||
description: 'Sends data to AWS ELB API',
|
||||
defaults: {
|
||||
name: 'AWS ELB',
|
||||
color: '#FF9900',
|
||||
},
|
||||
inputs: ['main'],
|
||||
outputs: ['main'],
|
||||
credentials: [
|
||||
{
|
||||
name: 'aws',
|
||||
required: true,
|
||||
},
|
||||
],
|
||||
properties: [
|
||||
{
|
||||
displayName: 'Resource',
|
||||
name: 'resource',
|
||||
type: 'options',
|
||||
noDataExpression: true,
|
||||
options: [
|
||||
{
|
||||
name: 'Listener Certificate',
|
||||
value: 'listenerCertificate',
|
||||
},
|
||||
{
|
||||
name: 'Load Balancer',
|
||||
value: 'loadBalancer',
|
||||
},
|
||||
],
|
||||
default: 'loadBalancer',
|
||||
},
|
||||
...loadBalancerOperations,
|
||||
...loadBalancerFields,
|
||||
|
||||
...listenerCertificateOperations,
|
||||
...listenerCertificateFields,
|
||||
],
|
||||
};
|
||||
|
||||
methods = {
|
||||
loadOptions: {
|
||||
async getLoadBalancers(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
|
||||
const returnData: INodePropertyOptions[] = [];
|
||||
|
||||
const params = ['Version=2015-12-01'];
|
||||
|
||||
const data = await awsApiRequestSOAP.call(
|
||||
this,
|
||||
'elasticloadbalancing',
|
||||
'GET',
|
||||
'/?Action=DescribeLoadBalancers&' + params.join('&'),
|
||||
);
|
||||
|
||||
let loadBalancers =
|
||||
data.DescribeLoadBalancersResponse.DescribeLoadBalancersResult.LoadBalancers.member;
|
||||
|
||||
if (!Array.isArray(loadBalancers)) {
|
||||
loadBalancers = [loadBalancers];
|
||||
}
|
||||
|
||||
for (const loadBalancer of loadBalancers) {
|
||||
const loadBalancerArn = loadBalancer.LoadBalancerArn as string;
|
||||
|
||||
const loadBalancerName = loadBalancer.LoadBalancerName as string;
|
||||
|
||||
returnData.push({
|
||||
name: loadBalancerName,
|
||||
value: loadBalancerArn,
|
||||
});
|
||||
}
|
||||
|
||||
return returnData;
|
||||
},
|
||||
|
||||
async getLoadBalancerListeners(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
|
||||
const returnData: INodePropertyOptions[] = [];
|
||||
|
||||
const loadBalancerId = this.getCurrentNodeParameter('loadBalancerId') as string;
|
||||
|
||||
const params = ['Version=2015-12-01', 'LoadBalancerArn=' + loadBalancerId];
|
||||
|
||||
const data = await awsApiRequestSOAP.call(
|
||||
this,
|
||||
'elasticloadbalancing',
|
||||
'GET',
|
||||
'/?Action=DescribeListeners&' + params.join('&'),
|
||||
);
|
||||
|
||||
let listeners = data.DescribeListenersResponse.DescribeListenersResult.Listeners.member;
|
||||
|
||||
if (!Array.isArray(listeners)) {
|
||||
listeners = [listeners];
|
||||
}
|
||||
|
||||
for (const listener of listeners) {
|
||||
const listenerArn = listener.ListenerArn as string;
|
||||
|
||||
const listenerName = listener.ListenerArn as string;
|
||||
|
||||
returnData.push({
|
||||
name: listenerArn,
|
||||
value: listenerName,
|
||||
});
|
||||
}
|
||||
|
||||
return returnData;
|
||||
},
|
||||
|
||||
async getSecurityGroups(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
|
||||
const returnData: INodePropertyOptions[] = [];
|
||||
|
||||
const body = ['Version=2016-11-15', 'Action=DescribeSecurityGroups'].join('&');
|
||||
|
||||
const data = await awsApiRequestSOAP.call(
|
||||
this,
|
||||
'ec2',
|
||||
'POST',
|
||||
'/',
|
||||
body,
|
||||
{},
|
||||
{
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
charset: 'utf-8',
|
||||
'User-Agent': 'aws-cli/1.18.124',
|
||||
},
|
||||
);
|
||||
|
||||
let securityGroups = data.DescribeSecurityGroupsResponse.securityGroupInfo.item;
|
||||
|
||||
if (!Array.isArray(securityGroups)) {
|
||||
securityGroups = [securityGroups];
|
||||
}
|
||||
|
||||
for (const securityGroup of securityGroups) {
|
||||
const securityGroupId = securityGroup.groupId as string;
|
||||
|
||||
const securityGroupName = securityGroup.groupName as string;
|
||||
|
||||
returnData.push({
|
||||
name: securityGroupName,
|
||||
value: securityGroupId,
|
||||
});
|
||||
}
|
||||
|
||||
return returnData;
|
||||
},
|
||||
|
||||
async getSubnets(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
|
||||
const returnData: INodePropertyOptions[] = [];
|
||||
|
||||
const body = ['Version=2016-11-15', 'Action=DescribeSubnets'].join('&');
|
||||
|
||||
const data = await awsApiRequestSOAP.call(
|
||||
this,
|
||||
'ec2',
|
||||
'POST',
|
||||
'/',
|
||||
body,
|
||||
{},
|
||||
{
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
charset: 'utf-8',
|
||||
'User-Agent': 'aws-cli/1.18.124',
|
||||
},
|
||||
);
|
||||
|
||||
let subnets = data.DescribeSubnetsResponse.subnetSet.item;
|
||||
|
||||
if (!Array.isArray(subnets)) {
|
||||
subnets = [subnets];
|
||||
}
|
||||
|
||||
for (const subnet of subnets) {
|
||||
const subnetId = subnet.subnetId as string;
|
||||
|
||||
const subnetName = subnet.subnetId as string;
|
||||
|
||||
returnData.push({
|
||||
name: subnetName,
|
||||
value: subnetId,
|
||||
});
|
||||
}
|
||||
|
||||
return returnData;
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
|
||||
const items = this.getInputData();
|
||||
const returnData: IDataObject[] = [];
|
||||
let responseData;
|
||||
const resource = this.getNodeParameter('resource', 0) as string;
|
||||
const operation = this.getNodeParameter('operation', 0) as string;
|
||||
|
||||
for (let i = 0; i < items.length; i++) {
|
||||
try {
|
||||
if (resource === 'listenerCertificate') {
|
||||
//https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_AddListenerCertificates.html
|
||||
if (operation === 'add') {
|
||||
const params = ['Version=2015-12-01'];
|
||||
|
||||
params.push(
|
||||
('Certificates.member.1.CertificateArn=' +
|
||||
this.getNodeParameter('certificateId', i)) as string,
|
||||
);
|
||||
|
||||
params.push(('ListenerArn=' + this.getNodeParameter('listenerId', i)) as string);
|
||||
|
||||
responseData = await awsApiRequestSOAP.call(
|
||||
this,
|
||||
'elasticloadbalancing',
|
||||
'GET',
|
||||
'/?Action=AddListenerCertificates&' + params.join('&'),
|
||||
);
|
||||
|
||||
responseData =
|
||||
responseData.AddListenerCertificatesResponse.AddListenerCertificatesResult
|
||||
.Certificates.member;
|
||||
}
|
||||
|
||||
//https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeListenerCertificates.html
|
||||
if (operation === 'getMany') {
|
||||
const params = ['Version=2015-12-01'];
|
||||
|
||||
const returnAll = this.getNodeParameter('returnAll', 0) as boolean;
|
||||
|
||||
const listenerId = this.getNodeParameter('listenerId', i) as string;
|
||||
|
||||
params.push(`ListenerArn=${listenerId}`);
|
||||
|
||||
if (returnAll) {
|
||||
responseData = await awsApiRequestSOAPAllItems.call(
|
||||
this,
|
||||
'DescribeListenerCertificatesResponse.DescribeListenerCertificatesResult.Certificates.member',
|
||||
'elasticloadbalancing',
|
||||
'GET',
|
||||
'/?Action=DescribeListenerCertificates&' + params.join('&'),
|
||||
);
|
||||
} else {
|
||||
params.push(('PageSize=' + this.getNodeParameter('limit', 0)) as string);
|
||||
|
||||
responseData = await awsApiRequestSOAP.call(
|
||||
this,
|
||||
'elasticloadbalancing',
|
||||
'GET',
|
||||
'/?Action=DescribeListenerCertificates&' + params.join('&'),
|
||||
);
|
||||
|
||||
responseData =
|
||||
responseData.DescribeListenerCertificatesResponse.DescribeListenerCertificatesResult
|
||||
.Certificates.member;
|
||||
}
|
||||
}
|
||||
|
||||
//https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_RemoveListenerCertificates.html
|
||||
if (operation === 'remove') {
|
||||
const params = ['Version=2015-12-01'];
|
||||
|
||||
params.push(
|
||||
('Certificates.member.1.CertificateArn=' +
|
||||
this.getNodeParameter('certificateId', i)) as string,
|
||||
);
|
||||
|
||||
params.push(('ListenerArn=' + this.getNodeParameter('listenerId', i)) as string);
|
||||
|
||||
responseData = await awsApiRequestSOAP.call(
|
||||
this,
|
||||
'elasticloadbalancing',
|
||||
'GET',
|
||||
'/?Action=RemoveListenerCertificates&' + params.join('&'),
|
||||
);
|
||||
|
||||
responseData = { sucess: true };
|
||||
}
|
||||
}
|
||||
|
||||
if (resource === 'loadBalancer') {
|
||||
//https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_CreateLoadBalancer.html
|
||||
if (operation === 'create') {
|
||||
const ipAddressType = this.getNodeParameter('ipAddressType', i) as string;
|
||||
|
||||
const name = this.getNodeParameter('name', i) as string;
|
||||
|
||||
const schema = this.getNodeParameter('schema', i) as string;
|
||||
|
||||
const type = this.getNodeParameter('type', i) as string;
|
||||
|
||||
const subnets = this.getNodeParameter('subnets', i) as string[];
|
||||
|
||||
const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
|
||||
|
||||
const params = ['Version=2015-12-01'];
|
||||
|
||||
params.push(`IpAddressType=${ipAddressType}`);
|
||||
|
||||
params.push(`Name=${name}`);
|
||||
|
||||
params.push(`Scheme=${schema}`);
|
||||
|
||||
params.push(`Type=${type}`);
|
||||
|
||||
for (let i = 1; i <= subnets.length; i++) {
|
||||
params.push(`Subnets.member.${i}=${subnets[i - 1]}`);
|
||||
}
|
||||
|
||||
if (additionalFields.securityGroups) {
|
||||
const securityGroups = additionalFields.securityGroups as string[];
|
||||
|
||||
for (let i = 1; i <= securityGroups.length; i++) {
|
||||
params.push(`SecurityGroups.member.${i}=${securityGroups[i - 1]}`);
|
||||
}
|
||||
}
|
||||
|
||||
if (additionalFields.tagsUi) {
|
||||
const tags = (additionalFields.tagsUi as IDataObject).tagValues as IDataObject[];
|
||||
|
||||
if (tags) {
|
||||
for (let i = 1; i <= tags.length; i++) {
|
||||
params.push(`Tags.member.${i}.Key=${tags[i - 1].key}`);
|
||||
|
||||
params.push(`Tags.member.${i}.Value=${tags[i - 1].value}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
responseData = await awsApiRequestSOAP.call(
|
||||
this,
|
||||
'elasticloadbalancing',
|
||||
'GET',
|
||||
'/?Action=CreateLoadBalancer&' + params.join('&'),
|
||||
);
|
||||
|
||||
responseData =
|
||||
responseData.CreateLoadBalancerResponse.CreateLoadBalancerResult.LoadBalancers.member;
|
||||
}
|
||||
|
||||
//https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DeleteLoadBalancer.html
|
||||
if (operation === 'delete') {
|
||||
const params = ['Version=2015-12-01'];
|
||||
|
||||
params.push(
|
||||
('LoadBalancerArn=' + this.getNodeParameter('loadBalancerId', i)) as string,
|
||||
);
|
||||
|
||||
responseData = await awsApiRequestSOAP.call(
|
||||
this,
|
||||
'elasticloadbalancing',
|
||||
'GET',
|
||||
'/?Action=DeleteLoadBalancer&' + params.join('&'),
|
||||
);
|
||||
|
||||
responseData = { success: true };
|
||||
}
|
||||
|
||||
//https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeLoadBalancers.html
|
||||
if (operation === 'getMany') {
|
||||
const params = ['Version=2015-12-01'];
|
||||
|
||||
const returnAll = this.getNodeParameter('returnAll', 0) as boolean;
|
||||
|
||||
if (returnAll) {
|
||||
const filters = this.getNodeParameter('filters', i) as IDataObject;
|
||||
|
||||
if (filters.names) {
|
||||
const names = (filters.names as string).split(',');
|
||||
|
||||
for (let i = 1; i <= names.length; i++) {
|
||||
params.push(`Names.member.${i}=${names[i - 1]}`);
|
||||
}
|
||||
}
|
||||
|
||||
responseData = await awsApiRequestSOAPAllItems.call(
|
||||
this,
|
||||
'DescribeLoadBalancersResponse.DescribeLoadBalancersResult.LoadBalancers.member',
|
||||
'elasticloadbalancing',
|
||||
'GET',
|
||||
'/?Action=DescribeLoadBalancers&' + params.join('&'),
|
||||
);
|
||||
} else {
|
||||
params.push(('PageSize=' + this.getNodeParameter('limit', 0)) as string);
|
||||
|
||||
responseData = await awsApiRequestSOAP.call(
|
||||
this,
|
||||
'elasticloadbalancing',
|
||||
'GET',
|
||||
'/?Action=DescribeLoadBalancers&' + params.join('&'),
|
||||
);
|
||||
|
||||
responseData =
|
||||
responseData.DescribeLoadBalancersResponse.DescribeLoadBalancersResult.LoadBalancers
|
||||
.member;
|
||||
}
|
||||
}
|
||||
|
||||
//https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeLoadBalancers.html
|
||||
if (operation === 'get') {
|
||||
const params = ['Version=2015-12-01'];
|
||||
|
||||
params.push(
|
||||
('LoadBalancerArns.member.1=' + this.getNodeParameter('loadBalancerId', i)) as string,
|
||||
);
|
||||
|
||||
responseData = await awsApiRequestSOAP.call(
|
||||
this,
|
||||
'elasticloadbalancing',
|
||||
'GET',
|
||||
'/?Action=DescribeLoadBalancers&' + params.join('&'),
|
||||
);
|
||||
|
||||
responseData =
|
||||
responseData.DescribeLoadBalancersResponse.DescribeLoadBalancersResult.LoadBalancers
|
||||
.member;
|
||||
}
|
||||
}
|
||||
|
||||
returnData.push(
|
||||
...this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), {
|
||||
itemData: { item: i },
|
||||
}),
|
||||
);
|
||||
} catch (error) {
|
||||
if (this.continueOnFail()) {
|
||||
returnData.push({ error: (error as JsonObject).toString() });
|
||||
continue;
|
||||
}
|
||||
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
return [returnData as INodeExecutionData[]];
|
||||
}
|
||||
}
|
95
packages/nodes-base/nodes/Aws/ELB/GenericFunctions.ts
Normal file
95
packages/nodes-base/nodes/Aws/ELB/GenericFunctions.ts
Normal file
|
@ -0,0 +1,95 @@
|
|||
import {
|
||||
get,
|
||||
} from 'lodash';
|
||||
|
||||
import {
|
||||
parseString,
|
||||
} from 'xml2js';
|
||||
|
||||
import {
|
||||
IExecuteFunctions,
|
||||
IHookFunctions,
|
||||
ILoadOptionsFunctions,
|
||||
IWebhookFunctions,
|
||||
} from 'n8n-core';
|
||||
|
||||
import {
|
||||
IDataObject, IHttpRequestOptions, JsonObject, NodeApiError,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
export async function awsApiRequest(this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions | IWebhookFunctions, service: string, method: string, path: string, body?: string | Buffer, query: IDataObject = {}, headers?: object, option: IDataObject = {}, region?: string): Promise<any> { // tslint:disable-line:no-any
|
||||
|
||||
const credentials = await this.getCredentials('aws');
|
||||
|
||||
const requestOptions = {
|
||||
qs: {
|
||||
...query,
|
||||
service,
|
||||
path,
|
||||
},
|
||||
headers,
|
||||
method,
|
||||
url: '',
|
||||
body,
|
||||
region: credentials?.region as string,
|
||||
} as IHttpRequestOptions;
|
||||
|
||||
try {
|
||||
return await this.helpers.requestWithAuthentication.call(this, 'aws', requestOptions);
|
||||
} catch (error) {
|
||||
throw new NodeApiError(this.getNode(), error as JsonObject);
|
||||
}
|
||||
}
|
||||
|
||||
export async function awsApiRequestREST(this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions, service: string, method: string, path: string, body?: string, query: IDataObject = {}, headers?: object, options: IDataObject = {}, region?: string): Promise<any> { // tslint:disable-line:no-any
|
||||
const response = await awsApiRequest.call(this, service, method, path, body, query, headers, options, region);
|
||||
try {
|
||||
return JSON.parse(response);
|
||||
} catch (e) {
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
||||
export async function awsApiRequestSOAP(this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions | IWebhookFunctions, service: string, method: string, path: string, body?: string | Buffer, query: IDataObject = {}, headers?: object, option: IDataObject = {}, region?: string): Promise<any> { // tslint:disable-line:no-any
|
||||
const response = await awsApiRequest.call(this, service, method, path, body, query, headers, option, region);
|
||||
try {
|
||||
return await new Promise((resolve, reject) => {
|
||||
parseString(response, { explicitArray: false }, (err, data) => {
|
||||
if (err) {
|
||||
return reject(err);
|
||||
}
|
||||
resolve(data);
|
||||
});
|
||||
});
|
||||
} catch (e) {
|
||||
return e;
|
||||
}
|
||||
}
|
||||
|
||||
export async function awsApiRequestSOAPAllItems(this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions | IWebhookFunctions, propertyName: string, service: string, method: string, path: string, body?: string, query: IDataObject = {}, headers: IDataObject = {}, option: IDataObject = {}, region?: string): Promise<any> { // tslint:disable-line:no-any
|
||||
|
||||
const returnData: IDataObject[] = [];
|
||||
|
||||
let responseData;
|
||||
|
||||
const propertyNameArray = propertyName.split('.');
|
||||
|
||||
do {
|
||||
responseData = await awsApiRequestSOAP.call(this, service, method, path, body, query, headers, option, region);
|
||||
|
||||
if (get(responseData, `${propertyNameArray[0]}.${propertyNameArray[1]}.NextMarker`)) {
|
||||
query['Marker'] = get(responseData, `${propertyNameArray[0]}.${propertyNameArray[1]}.NextMarker`);
|
||||
}
|
||||
if (get(responseData, propertyName)) {
|
||||
if (Array.isArray(get(responseData, propertyName))) {
|
||||
returnData.push.apply(returnData, get(responseData, propertyName));
|
||||
} else {
|
||||
returnData.push(get(responseData, propertyName));
|
||||
}
|
||||
}
|
||||
} while (
|
||||
get(responseData, `${propertyNameArray[0]}.${propertyNameArray[1]}.NextMarker`) !== undefined
|
||||
);
|
||||
|
||||
return returnData;
|
||||
}
|
|
@ -0,0 +1,269 @@
|
|||
import {
|
||||
INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
export const listenerCertificateOperations: INodeProperties[] = [
|
||||
{
|
||||
displayName: 'Operation',
|
||||
name: 'operation',
|
||||
type: 'options',
|
||||
noDataExpression: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'listenerCertificate',
|
||||
],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: 'Add',
|
||||
value: 'add',
|
||||
description: 'Add the specified SSL server certificate to the certificate list for the specified HTTPS or TLS listener',
|
||||
action: 'Add a listener certificate',
|
||||
},
|
||||
{
|
||||
name: 'Get Many',
|
||||
value: 'getMany',
|
||||
description: 'Get many listener certificates',
|
||||
action: 'Get many listener certificates',
|
||||
},
|
||||
{
|
||||
name: 'Remove',
|
||||
value: 'remove',
|
||||
description: 'Remove the specified certificate from the certificate list for the specified HTTPS or TLS listener',
|
||||
action: 'Remove a listener certificate',
|
||||
},
|
||||
],
|
||||
default: 'add',
|
||||
},
|
||||
];
|
||||
|
||||
export const listenerCertificateFields: INodeProperties[] = [
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* listenerCertificate:add */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
{
|
||||
displayName: 'Load Balancer ARN Name or ID',
|
||||
name: 'loadBalancerId',
|
||||
type: 'options',
|
||||
typeOptions: {
|
||||
loadOptionsMethod: 'getLoadBalancers',
|
||||
},
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'listenerCertificate',
|
||||
],
|
||||
operation: [
|
||||
'add',
|
||||
],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
description: 'Unique identifier for a particular loadBalancer. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
||||
},
|
||||
{
|
||||
displayName: 'Listener ARN Name or ID',
|
||||
name: 'listenerId',
|
||||
type: 'options',
|
||||
required: true,
|
||||
typeOptions: {
|
||||
loadOptionsMethod: 'getLoadBalancerListeners',
|
||||
loadOptionsDependsOn: [
|
||||
'loadBalancerId',
|
||||
],
|
||||
},
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'listenerCertificate',
|
||||
],
|
||||
operation: [
|
||||
'add',
|
||||
],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
description: 'Unique identifier for a particular loadBalancer. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
||||
},
|
||||
{
|
||||
displayName: 'Certificate ARN',
|
||||
name: 'certificateId',
|
||||
type: 'string',
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'listenerCertificate',
|
||||
],
|
||||
operation: [
|
||||
'add',
|
||||
],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
description: 'Unique identifier for a particular loadBalancer',
|
||||
},
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* listenerCertificate:getMany */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
{
|
||||
displayName: 'Load Balancer ARN Name or ID',
|
||||
name: 'loadBalancerId',
|
||||
type: 'options',
|
||||
typeOptions: {
|
||||
loadOptionsMethod: 'getLoadBalancers',
|
||||
},
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'listenerCertificate',
|
||||
],
|
||||
operation: [
|
||||
'getMany',
|
||||
],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
description: 'Unique identifier for a particular loadBalancer. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
||||
},
|
||||
{
|
||||
displayName: 'Listener ARN Name or ID',
|
||||
name: 'listenerId',
|
||||
type: 'options',
|
||||
required: true,
|
||||
typeOptions: {
|
||||
loadOptionsMethod: 'getLoadBalancerListeners',
|
||||
loadOptionsDependsOn: [
|
||||
'loadBalancerId',
|
||||
],
|
||||
},
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'listenerCertificate',
|
||||
],
|
||||
operation: [
|
||||
'getMany',
|
||||
],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
description: 'Unique identifier for a particular loadBalancer. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
||||
},
|
||||
{
|
||||
displayName: 'Return All',
|
||||
name: 'returnAll',
|
||||
type: 'boolean',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'listenerCertificate',
|
||||
],
|
||||
operation: [
|
||||
'getMany',
|
||||
],
|
||||
},
|
||||
},
|
||||
default: false,
|
||||
description: 'Whether to return all results or only up to a given limit',
|
||||
},
|
||||
{
|
||||
displayName: 'Limit',
|
||||
name: 'limit',
|
||||
type: 'number',
|
||||
description: 'Max number of results to return',
|
||||
default: 100,
|
||||
typeOptions: {
|
||||
maxValue: 400,
|
||||
minValue: 1,
|
||||
},
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'listenerCertificate',
|
||||
],
|
||||
operation: [
|
||||
'getMany',
|
||||
],
|
||||
returnAll: [
|
||||
false,
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* listenerCertificate:remove */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
{
|
||||
displayName: 'Load Balancer ARN Name or ID',
|
||||
name: 'loadBalancerId',
|
||||
type: 'options',
|
||||
typeOptions: {
|
||||
loadOptionsMethod: 'getLoadBalancers',
|
||||
},
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'listenerCertificate',
|
||||
],
|
||||
operation: [
|
||||
'remove',
|
||||
],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
description: 'Unique identifier for a particular loadBalancer. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
||||
},
|
||||
{
|
||||
displayName: 'Listener ARN Name or ID',
|
||||
name: 'listenerId',
|
||||
type: 'options',
|
||||
required: true,
|
||||
typeOptions: {
|
||||
loadOptionsMethod: 'getLoadBalancerListeners',
|
||||
loadOptionsDependsOn: [
|
||||
'loadBalancerId',
|
||||
],
|
||||
},
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'listenerCertificate',
|
||||
],
|
||||
operation: [
|
||||
'remove',
|
||||
],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
description: 'Unique identifier for a particular loadBalancer. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
||||
},
|
||||
{
|
||||
displayName: 'Certificate ARN',
|
||||
name: 'certificateId',
|
||||
type: 'string',
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'listenerCertificate',
|
||||
],
|
||||
operation: [
|
||||
'remove',
|
||||
],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
description: 'Unique identifier for a particular loadBalancer',
|
||||
},
|
||||
|
||||
];
|
353
packages/nodes-base/nodes/Aws/ELB/LoadBalancerDescription.ts
Normal file
353
packages/nodes-base/nodes/Aws/ELB/LoadBalancerDescription.ts
Normal file
|
@ -0,0 +1,353 @@
|
|||
import {
|
||||
INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
export const loadBalancerOperations: INodeProperties[] = [
|
||||
{
|
||||
displayName: 'Operation',
|
||||
name: 'operation',
|
||||
type: 'options',
|
||||
noDataExpression: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'loadBalancer',
|
||||
],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: 'Create',
|
||||
value: 'create',
|
||||
description: 'Create a load balancer',
|
||||
action: 'Create a load balancer',
|
||||
},
|
||||
{
|
||||
name: 'Delete',
|
||||
value: 'delete',
|
||||
description: 'Delete a load balancer',
|
||||
action: 'Delete a load balancer',
|
||||
},
|
||||
{
|
||||
name: 'Get',
|
||||
value: 'get',
|
||||
description: 'Get a load balancer',
|
||||
action: 'Get a load balancer',
|
||||
},
|
||||
{
|
||||
name: 'Get Many',
|
||||
value: 'getMany',
|
||||
description: 'Get many load balancers',
|
||||
action: 'Get many load balancers',
|
||||
},
|
||||
],
|
||||
default: 'create',
|
||||
},
|
||||
];
|
||||
|
||||
export const loadBalancerFields: INodeProperties[] = [
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* loadBalancer:create */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
{
|
||||
displayName: 'IP Address Type',
|
||||
name: 'ipAddressType',
|
||||
type: 'options',
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'loadBalancer',
|
||||
],
|
||||
operation: [
|
||||
'create',
|
||||
],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: 'Ipv4',
|
||||
value: 'ipv4',
|
||||
},
|
||||
{
|
||||
name: 'Dualstack',
|
||||
value: 'dualstack',
|
||||
},
|
||||
],
|
||||
default: 'ipv4',
|
||||
description: 'The type of IP addresses used by the subnets for your load balancer',
|
||||
},
|
||||
{
|
||||
displayName: 'Name',
|
||||
name: 'name',
|
||||
type: 'string',
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'loadBalancer',
|
||||
],
|
||||
operation: [
|
||||
'create',
|
||||
],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
description: 'This name must be unique per region per account, can have a maximum of 32 characters',
|
||||
},
|
||||
{
|
||||
displayName: 'Schema',
|
||||
name: 'schema',
|
||||
type: 'options',
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'loadBalancer',
|
||||
],
|
||||
operation: [
|
||||
'create',
|
||||
],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: 'Internal',
|
||||
value: 'internal',
|
||||
},
|
||||
{
|
||||
name: 'Internet Facing',
|
||||
value: 'internet-facing',
|
||||
},
|
||||
],
|
||||
default: 'internet-facing',
|
||||
},
|
||||
{
|
||||
displayName: 'Type',
|
||||
name: 'type',
|
||||
type: 'options',
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'loadBalancer',
|
||||
],
|
||||
operation: [
|
||||
'create',
|
||||
],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: 'Application',
|
||||
value: 'application',
|
||||
},
|
||||
{
|
||||
name: 'Network',
|
||||
value: 'network',
|
||||
},
|
||||
],
|
||||
default: 'application',
|
||||
},
|
||||
{
|
||||
displayName: 'Subnet ID Names or IDs',
|
||||
name: 'subnets',
|
||||
type: 'multiOptions',
|
||||
description: 'Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'loadBalancer',
|
||||
],
|
||||
operation: [
|
||||
'create',
|
||||
],
|
||||
},
|
||||
},
|
||||
typeOptions: {
|
||||
loadOptionsMethod: 'getSubnets',
|
||||
},
|
||||
required: true,
|
||||
default: [],
|
||||
},
|
||||
{
|
||||
displayName: 'Additional Fields',
|
||||
name: 'additionalFields',
|
||||
type: 'collection',
|
||||
placeholder: 'Add Field',
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: [
|
||||
'create',
|
||||
],
|
||||
resource: [
|
||||
'loadBalancer',
|
||||
],
|
||||
},
|
||||
},
|
||||
default: {},
|
||||
options: [
|
||||
{
|
||||
displayName: 'Security Group IDs',
|
||||
name: 'securityGroups',
|
||||
type: 'multiOptions',
|
||||
description: 'Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
||||
typeOptions: {
|
||||
loadOptionsMethod: 'getSecurityGroups',
|
||||
},
|
||||
default: [],
|
||||
},
|
||||
{
|
||||
displayName: 'Tags',
|
||||
name: 'tagsUi',
|
||||
placeholder: 'Add Tag',
|
||||
type: 'fixedCollection',
|
||||
default: {},
|
||||
typeOptions: {
|
||||
multipleValues: true,
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: 'tagValues',
|
||||
displayName: 'Tag',
|
||||
values: [
|
||||
{
|
||||
displayName: 'Key',
|
||||
name: 'key',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'The key of the tag',
|
||||
},
|
||||
{
|
||||
displayName: 'Value',
|
||||
name: 'value',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'The value of the tag',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* loadBalancer:get */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
{
|
||||
displayName: 'Load Balancer ARN',
|
||||
name: 'loadBalancerId',
|
||||
type: 'string',
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'loadBalancer',
|
||||
],
|
||||
operation: [
|
||||
'get',
|
||||
],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
description: 'Unique identifier for a particular loadBalancer',
|
||||
},
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* loadBalancer:getMany */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
{
|
||||
displayName: 'Return All',
|
||||
name: 'returnAll',
|
||||
type: 'boolean',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'loadBalancer',
|
||||
],
|
||||
operation: [
|
||||
'getMany',
|
||||
],
|
||||
},
|
||||
},
|
||||
default: false,
|
||||
description: 'Whether to return all results or only up to a given limit',
|
||||
},
|
||||
{
|
||||
displayName: 'Limit',
|
||||
name: 'limit',
|
||||
type: 'number',
|
||||
description: 'Max number of results to return',
|
||||
default: 100,
|
||||
typeOptions: {
|
||||
maxValue: 400,
|
||||
minValue: 1,
|
||||
},
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'loadBalancer',
|
||||
],
|
||||
operation: [
|
||||
'getMany',
|
||||
],
|
||||
returnAll: [
|
||||
false,
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'Filters',
|
||||
name: 'filters',
|
||||
type: 'collection',
|
||||
placeholder: 'Add Filter',
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: [
|
||||
'getMany',
|
||||
],
|
||||
resource: [
|
||||
'loadBalancer',
|
||||
],
|
||||
returnAll: [
|
||||
true,
|
||||
],
|
||||
},
|
||||
},
|
||||
default: {},
|
||||
options: [
|
||||
{
|
||||
displayName: 'Names',
|
||||
name: 'names',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'The names of the load balancers. Multiples can be defined separated by comma.',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* loadBalancer:delete */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
{
|
||||
displayName: 'Load Balancer ARN',
|
||||
name: 'loadBalancerId',
|
||||
type: 'string',
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'loadBalancer',
|
||||
],
|
||||
operation: [
|
||||
'delete',
|
||||
],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
description: 'ID of loadBalancer to delete',
|
||||
},
|
||||
];
|
1
packages/nodes-base/nodes/Aws/ELB/elb.svg
Normal file
1
packages/nodes-base/nodes/Aws/ELB/elb.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 74.375 85" fill="#fff" fill-rule="evenodd" stroke="#000" stroke-linecap="round" stroke-linejoin="round"><style><![CDATA[.B{fill:#f58536}.C{fill:#9d5025}]]></style><use xlink:href="#A" x="2.188" y="2.5"/><symbol id="A" overflow="visible"><g stroke="none"><path d="M3.511 14.898L0 16.56v46.88l3.511 1.662L17.423 40 3.511 14.898z" class="C"/><path d="M11.694 63.285l-8.183 1.817V14.898l8.183 1.769v46.618z" class="B"/><path d="M7.382 13.061l4.312-2.031L21.899 40 11.694 68.97l-4.312-2.031V13.061z" class="C"/><path d="M21.899 66.239L11.694 68.97V11.03l10.205 2.741v52.468z" class="B"/><path d="M16.499 8.747l5.4-2.556L55.616 40 21.899 73.8l-5.4-2.546V8.747z" class="C"/><path d="M58.357 61.031L21.899 73.8V6.191l36.458 12.614v42.225z" class="B"/><path d="M53.634 33.693l-6.807.418-18.819-1.506L34.99 0l18.645 33.693z" fill="#6b3a19"/><path d="M34.99 31.934V0l-6.982 3.304v29.3l6.982-.67z" class="C"/><path d="M53.635 33.693V8.824L34.99 0v31.934l18.645 1.759z" class="B"/><path d="M53.634 46.094l-6.448-.389-19.179 1.536L34.99 80l18.645-33.907z" fill="#fbbf93"/><path d="M28.008 47.24v29.465L34.99 80V47.842l-6.982-.602z" class="C"/><path d="M34.99 47.842V80l18.645-8.824V46.093L34.99 47.842z" class="B"/><path d="M70 44.558l-4.004-.156-10.38.865 4.394 22.896L70 44.558z" fill="#fbbf93"/><path d="M60.01 45.491v22.672L70 63.431V44.558l-9.99.933z" class="B"/><path d="M70 35.248l-4.004.155-10.38-.875 4.394-22.692L70 35.248z" fill="#6b3a19"/><path d="M70 35.248V16.57l-9.99-4.733v22.459l9.99.952z" class="B"/><path d="M55.616 67.065l4.394 1.098V45.491l-4.394-.224v21.798zm0-54.13l4.394-1.098v22.459l-4.394.233V12.935z" class="C"/></g></symbol></svg>
|
After Width: | Height: | Size: 1.7 KiB |
|
@ -362,6 +362,7 @@
|
|||
"dist/nodes/Aws/AwsSnsTrigger.node.js",
|
||||
"dist/nodes/Aws/Comprehend/AwsComprehend.node.js",
|
||||
"dist/nodes/Aws/DynamoDB/AwsDynamoDB.node.js",
|
||||
"dist/nodes/Aws/ELB/AwsElb.node.js",
|
||||
"dist/nodes/Aws/Rekognition/AwsRekognition.node.js",
|
||||
"dist/nodes/Aws/S3/AwsS3.node.js",
|
||||
"dist/nodes/Aws/SES/AwsSes.node.js",
|
||||
|
|
Loading…
Reference in a new issue