Skip to content

Commit

Permalink
Bugfix/coginto pool (#1159)
Browse files Browse the repository at this point in the history
* passwordPolicy scope fix to avoid nil values

* lambda vars minor enhancement
  • Loading branch information
gaurav-gogia authored Feb 22, 2022
1 parent 2f294b4 commit a524076
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pkg/mapper/iac-providers/cft/config/cognito-user-pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ type CognitoUserPoolConfig struct {
func GetCognitoUserPoolConfig(u *cognito.UserPool) []AWSResourceConfig {
var passwordPolicy []PasswordPolicyBlock
if u.Policies != nil && u.Policies.PasswordPolicy != nil {
passwordPolicy := make([]PasswordPolicyBlock, 1)
passwordPolicy = make([]PasswordPolicyBlock, 1)

passwordPolicy[0].MinimumLength = u.Policies.PasswordPolicy.MinimumLength
passwordPolicy[0].RequireLowercase = u.Policies.PasswordPolicy.RequireLowercase
Expand Down
12 changes: 9 additions & 3 deletions pkg/mapper/iac-providers/cft/config/lambda-function.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,25 @@ type LambdaFunctionConfig struct {

// GetLambdaFunctionConfig returns config for LambdaFunction
func GetLambdaFunctionConfig(f *lambda.Function) []AWSResourceConfig {
tracingConfig := make([]TracingConfigBlock, 1)
var tracingConfig []TracingConfigBlock
if f.TracingConfig != nil {
tracingConfig = make([]TracingConfigBlock, 1)

tracingConfig[0].Mode = f.TracingConfig.Mode
}

vpcConfig := make([]VPCConfigBlock, 1)
var vpcConfig []VPCConfigBlock
if f.VpcConfig != nil {
vpcConfig = make([]VPCConfigBlock, 1)

vpcConfig[0].SecurityGroupIDs = f.VpcConfig.SecurityGroupIds
vpcConfig[0].SubnetIDs = f.VpcConfig.SubnetIds
}

environment := make([]EnvironmentBlock, 1)
var environment []EnvironmentBlock
if f.Environment != nil {
environment = make([]EnvironmentBlock, 1)

environment[0].Variables = f.Environment.Variables
}

Expand Down

0 comments on commit a524076

Please sign in to comment.