-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/gh 118 aws virtual network #624
base: develop
Are you sure you want to change the base?
Conversation
return nil | ||
} | ||
|
||
func (g *awsGenerator) generateSubnet(ctx context.Context, nodeParams nodeParams, instanceName string, outputs map[string]string) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Method awsGenerator.generateSubnet
has a Cognitive Complexity of 22 (exceeds 20 allowed). Consider refactoring.
return nil | ||
} | ||
|
||
func (g *awsGenerator) generateSubnet(ctx context.Context, nodeParams nodeParams, instanceName string, outputs map[string]string) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Method awsGenerator.generateSubnet
has 65 lines of code (exceeds 50 allowed). Consider refactoring.
"github.com/ystia/yorc/v4/prov/terraform/commons" | ||
) | ||
|
||
func (g *awsGenerator) generateVPC(ctx context.Context, nodeParams nodeParams, instanceName string, outputs map[string]string) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Method awsGenerator.generateVPC
has 52 lines of code (exceeds 50 allowed). Consider refactoring.
return nil | ||
} | ||
|
||
func (g *awsGenerator) generateSubnet(ctx context.Context, nodeParams nodeParams, instanceName string, outputs map[string]string) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Method awsGenerator.generateSubnet
has 54 lines of code (exceeds 50 allowed). Consider refactoring.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some typos in tosca, otherwise, looks good !
To be tested on real AWS infra to make sure that all works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems you don't allow to attach an existing vpc to a compute ?
Can't open topology.zip |
VPC can't be attached to compute instance, only subnet can. |
Ok but we should allow to attach an existing subnet from an existing VPC to a compute ? |
Ok got it ! |
prov/terraform/aws/resources.go
Outdated
Attachment map[string]string `json:"attachment,omitempty"` | ||
} | ||
|
||
// todo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment on exported type SecurityRule should be of the form "SecurityRule ..." (with optional leading article)
prov/terraform/aws/resources.go
Outdated
CidrBlock []string `json:"cidr_blocks,omitempty"` | ||
} | ||
|
||
// todo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment on exported type SecurityGroups should be of the form "SecurityGroups ..." (with optional leading article)
prov/terraform/aws/resources.go
Outdated
Name string `json:"name,omitempty"` | ||
} | ||
|
||
// todo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment on exported type RouteTable should be of the form "RouteTable ..." (with optional leading article)
DependsOn []string `json:"depends_on,omitempty"` | ||
} | ||
|
||
type DefaultRouteTable struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported type DefaultRouteTable should have comment or be unexported
prov/terraform/aws/resources.go
Outdated
DependsOn []string `json:"depends_on,omitempty"` | ||
} | ||
|
||
// todo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment on exported type InternetGateway should be of the form "InternetGateway ..." (with optional leading article)
prov/terraform/aws/aws_instance.go
Outdated
i := 0 | ||
for _, networkReq := range networkRequirements { | ||
networkInterface := &NetworkInterface{} | ||
// TODO : Check if subnet and security group are defined in relationship |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO found
Kudos, SonarCloud Quality Gate passed! 0 Bugs |
name = strings.Replace(strings.ToLower(name), "_", "-", -1) | ||
|
||
// First interface will be considered the network interface of the Compute Instance | ||
if i == 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Identical blocks of code found in 2 locations. Consider refactoring.
name = strings.Replace(strings.ToLower(name), "_", "-", -1) | ||
|
||
// First interface will be considered the network interface of the Compute Instance | ||
if i == 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Identical blocks of code found in 2 locations. Consider refactoring.
Code Climate has analyzed commit c0641d8 and detected 3 issues on this pull request. Here's the issue category breakdown:
View more on Code Climate. |
SonarCloud Quality Gate failed. 0 Bugs 76.5% Coverage The version of Java (1.8.0_151) you have used to run this analysis is deprecated and we will stop accepting it from October 2020. Please update to at least Java 11. |
Pull Request description
Description of the change
Now possible to attach a subnet to AWS instance.
What I did
How I did it
How to verify it
-Try deploying a ACompute linked with a ANetwork.
Applicable Issues
#Fixes #118