Skip to content

Commit

Permalink
Update metadata with default attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
Zorin95670 committed Jul 22, 2024
1 parent 6ad79d3 commit 2c781e2
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 189 deletions.
26 changes: 5 additions & 21 deletions src/assets/metadata/aws/compute.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { securityGroups, subnetId } from 'src/assets/metadata/aws/default';

const awsInstance = {
type: 'aws_instance',
blockType: 'resource',
Expand All @@ -11,14 +13,8 @@ const awsInstance = {
tags: [],
definedAttributes: [
{
name: 'security_groups',
displayName: 'Security groups',
description: 'List of security group names to associate with.',
linkAttribute: 'name',
linkRef: 'aws_security_group',
...securityGroups,
linkType: 'Reverse',
linkModel: 'defaultLink',
type: 'Link',
url: 'https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/instance#security_groups',
},
{
Expand All @@ -33,14 +29,8 @@ const awsInstance = {
url: 'https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/instance#vpc_security_group_ids',
},
{
name: 'subnet_id',
displayName: 'Subnet ID',
...subnetId,
description: 'The VPC Subnet ID to launch in.',
linkAttribute: 'id',
linkRef: 'aws_subnet',
linkType: 'Default',
linkModel: 'defaultLink',
type: 'Link',
url: 'https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/instance#subnet_id',
},
],
Expand Down Expand Up @@ -120,13 +110,7 @@ const awsLaunchConfiguration = {
url: 'https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/launch_configuration.html#name_prefix',
},
{
name: 'security_groups',
displayName: 'Security groups',
description: 'A list of associated security group IDS.',
linkRef: 'aws_security_group',
linkType: 'Default',
linkModel: 'defaultLink',
type: 'Link',
...securityGroups,
url: 'https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/launch_configuration.html#security_groups',
},
{
Expand Down
15 changes: 4 additions & 11 deletions src/assets/metadata/aws/databases.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { port, tags } from 'src/assets/metadata/aws/default';

const awsDbInstance = {
type: 'aws_db_instance',
blockType: 'resource',
Expand Down Expand Up @@ -290,15 +292,9 @@ const awsDbInstance = {
url: 'https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/db_instance#performance_insights_retention_period',
},
{
name: 'port',
displayName: 'Port',
...port,
description: 'The port on which the DB accepts connections.',
type: 'Number',
url: 'https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/db_instance#port',
rules: {
max: '65535',
min: '1',
},
},
{
name: 'replica_mode',
Expand Down Expand Up @@ -458,10 +454,7 @@ const awsDbInstance = {
url: 'https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/db_instance#customer_owned_ip_enabled',
},
{
name: 'tags',
displayName: 'Tags',
description: 'A mapping of tags to assign to the DB instance.',
type: 'Object',
...tags,
url: 'https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/db_instance#tags',
},
],
Expand Down
75 changes: 19 additions & 56 deletions src/assets/metadata/aws/loadbalancing.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
import {
port,
securityGroups, subnetId,
tags,
vpcIdLink,
vpcIdReference,
} from 'src/assets/metadata/aws/default';

const awsElb = {
type: 'aws_elb',
blockType: 'resource',
Expand Down Expand Up @@ -64,14 +72,7 @@ const awsElb = {
url: 'https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/elb#subnets',
},
{
name: 'security_groups',
displayName: 'Security groups',
description: 'A list of security group IDs to assign to the ELB.',
linkAttribute: 'id',
linkRef: 'aws_security_group',
linkType: 'Default',
linkModel: 'defaultLink',
type: 'Link',
...securityGroups,
url: 'https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/elb#security_groups',
},
{
Expand Down Expand Up @@ -101,11 +102,8 @@ const awsLb = {
tags: [],
definedAttributes: [
{
name: 'vpc_id',
displayName: 'VPC ID',
...vpcIdReference,
description: 'The ID of the VPC to create the ALB in.',
containerRef: 'aws_vpc',
type: 'Reference',
url: 'https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lb#vpc_id',
},
{
Expand Down Expand Up @@ -249,13 +247,7 @@ const awsLb = {
},
},
{
name: 'security_groups',
displayName: 'Security groups',
description: 'A list of security group IDs to assign to the LB. Only valid for Load Balancers of type application.',
linkRef: 'aws_security_group',
linkType: 'Default',
linkModel: 'defaultLink',
type: 'Link',
...securityGroups,
url: 'https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lb#security_groups',
},
{
Expand All @@ -273,10 +265,8 @@ const awsLb = {
url: 'https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lb#subnet_mapping',
definedAttributes: [
{
name: 'subnet_id',
displayName: 'Subnet ID',
...subnetId,
description: 'ID of the subnet of which to attach to the load balancer. You can specify only one subnet per Availability Zone.',
type: 'String',
url: 'https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lb#subnet_id',
},
{
Expand Down Expand Up @@ -320,10 +310,7 @@ const awsLb = {
url: 'https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lb#name_prefix',
},
{
name: 'tags',
displayName: 'Tags',
description: 'A map of tags to assign to the resource. If configured with a provider default_tags configuration block present,<br>tags with matching keys will overwrite those defined at the provider-level.',
type: 'Object',
...tags,
url: 'https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lb#tags',
},
],
Expand Down Expand Up @@ -390,10 +377,8 @@ const awsLbTargetGroup = {
url: 'https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lb_target_group#name_prefix',
},
{
name: 'port',
displayName: 'Port',
...port,
description: 'Port on which targets receive traffic, unless overridden when registering a specific target.',
type: 'Number',
url: 'https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lb_target_group#port',
},
{
Expand Down Expand Up @@ -463,13 +448,8 @@ const awsLbTargetGroup = {
},
},
{
name: 'vpc_id',
displayName: 'VPC ID',
...vpcIdLink,
description: 'Identifier of the VPC in which to create the target group.',
linkRef: 'aws_vpc',
linkType: 'Default',
linkModel: 'defaultLink',
type: 'Link',
url: 'https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lb_target_group#vpc_id',
},
{
Expand Down Expand Up @@ -515,10 +495,8 @@ const awsLbTargetGroup = {
url: 'https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lb_target_group#path',
},
{
name: 'port',
displayName: 'Port',
...port,
description: 'The port the load balancer uses when performing health checks on targets.',
type: 'Number',
url: 'https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lb_target_group#port',
},
{
Expand Down Expand Up @@ -597,13 +575,7 @@ const awsLbTargetGroup = {
},
],
},
{
name: 'tags',
displayName: 'Tags',
description: 'A map of tags to assign to the resource.',
type: 'Object',
url: 'https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html',
},
tags,
{
name: 'target_failover',
displayName: 'Target failover',
Expand Down Expand Up @@ -710,15 +682,9 @@ const awsLbListener = {
url: 'https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lb_listener#certificate_arn',
},
{
name: 'port',
displayName: 'Port',
...port,
description: 'Port on which the load balancer is listening.',
type: 'Number',
url: 'https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lb_listener#port',
rules: {
max: 65535,
min: 1,
},
},
{
name: 'protocol',
Expand Down Expand Up @@ -761,10 +727,7 @@ const awsLbListener = {
url: 'https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lb_listener#ssl_policy',
},
{
name: 'tags',
displayName: 'Tags',
description: 'A mapping of tags to assign to the resource.',
type: 'Object',
...tags,
url: 'https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lb_listener#tags',
},
],
Expand Down
58 changes: 11 additions & 47 deletions src/assets/metadata/aws/networking.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { subnetId, tags, vpcIdReference } from 'src/assets/metadata/aws/default';

const awsVpc = {
type: 'aws_vpc',
blockType: 'resource',
Expand Down Expand Up @@ -130,13 +132,7 @@ const awsVpc = {
type: 'Boolean',
url: 'https://docs.aws.amazon.com/vpc/latest/userguide/network-address-usage.html',
},
{
name: 'tags',
displayName: 'Tags',
description: 'A map of tags to assign to the resource.',
type: 'Object',
url: 'https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html',
},
tags,
],
};

Expand All @@ -153,12 +149,9 @@ const awsSubnet = {
tags: [],
definedAttributes: [
{
name: 'vpc_id',
displayName: 'VPC ID',
...vpcIdReference,
description: 'The VPC ID to create the subnet in.',
containerRef: 'aws_vpc',
required: true,
type: 'Reference',
url: 'https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/subnet#vpc_id',
},
{
Expand Down Expand Up @@ -274,10 +267,7 @@ const awsSubnet = {
url: 'https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/subnet#outpost_arn',
},
{
name: 'tags',
displayName: 'Tags',
description: 'A map of tags to assign to the resource.',
type: 'Object',
...tags,
url: 'https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/subnet#tags',
},
],
Expand Down Expand Up @@ -357,12 +347,9 @@ const awsRouteTable = {
tags: [],
definedAttributes: [
{
name: 'vpc_id',
displayName: 'VPC ID',
...vpcIdReference,
description: 'The ID of the VPC for which to create the route table.',
containerRef: 'aws_vpc',
required: true,
type: 'Reference',
url: 'https://docs.aws.amazon.com/vpc/latest/userguide/what-is-amazon-vpc.html',
},
{
Expand All @@ -372,13 +359,7 @@ const awsRouteTable = {
type: 'Array',
url: 'https://docs.aws.amazon.com/directconnect/latest/UserGuide/virtualgateways.html',
},
{
name: 'tags',
displayName: 'Tags',
description: 'A map of tags to assign to the resource.',
type: 'Object',
url: 'https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html',
},
tags,
],
};

Expand All @@ -395,11 +376,8 @@ const awsRouteTableAssociation = {
tags: [],
definedAttributes: [
{
name: 'vpc_id',
displayName: 'VPC ID',
...vpcIdReference,
description: 'The ID of the VPC for which to create the route table association.',
containerRef: 'aws_vpc',
type: 'Reference',
url: 'https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Route_Tables.html',
},
{
Expand All @@ -424,13 +402,8 @@ const awsRouteTableAssociation = {
url: 'https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Internet_Gateway.html',
},
{
name: 'subnet_id',
displayName: 'Subnet ID',
...subnetId,
description: 'The ID of the subnet to associate the route table with. Conflicts with gateway_id.',
linkRef: 'aws_subnet',
linkType: 'Default',
linkModel: 'defaultLink',
type: 'Link',
url: 'https://docs.aws.amazon.com/vpc/latest/userguide/configure-subnets.html',
},
],
Expand All @@ -449,20 +422,11 @@ const awsInternetGateway = {
tags: [],
definedAttributes: [
{
name: 'vpc_id',
displayName: 'VPC ID',
...vpcIdReference,
description: 'The VPC ID to create the gateway in.',
containerRef: 'aws_vpc',
type: 'Reference',
url: 'https://docs.aws.amazon.com/vpc/latest/userguide/what-is-amazon-vpc.html',
},
{
name: 'tags',
displayName: 'Tags',
description: 'A map of tags to assign to the resource.',
type: 'Object',
url: 'https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html',
},
tags,
],
};

Expand Down
Loading

0 comments on commit 2c781e2

Please sign in to comment.