Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Query: '#{query}',
StatusCode: 'HTTP_301'
}
}],
LoadBalancerArn: cf.ref('TaskingManagerLoadBalancer'),
Port: 80,
Protocol: 'HTTP'
}
},
TaskingManagerRDS: {
Type: 'AWS::RDS::DBInstance',
Properties: {
Engine: 'postgres',
DBName: cf.if('UseASnapshot', cf.noValue, cf.ref('PostgresDB')),
EngineVersion: '11.5',
MasterUsername: cf.if('UseASnapshot', cf.noValue, cf.ref('PostgresUser')),
MasterUserPassword: cf.if('UseASnapshot', cf.noValue, cf.ref('PostgresPassword')),
AllocatedStorage: cf.ref('DatabaseSize'),
BackupRetentionPeriod: 10,
StorageType: 'gp2',
DBParameterGroupName: 'tm3-logging-postgres11',
EnableCloudwatchLogsExports: ['postgresql'],
DBInstanceClass: cf.if('IsTaskingManagerProduction', 'db.t3.2xlarge', 'db.t2.small'),
DBSnapshotIdentifier: cf.if('UseASnapshot', cf.ref('DBSnapshot'), cf.noValue),
VPCSecurityGroups: [cf.importValue(cf.join('-', ['hotosm-network-production', cf.ref('NetworkEnvironment'), 'ec2s-security-group', cf.region]))],
}
}
};
module.exports = { Parameters, Resources, Conditions }
Host: '#{host}',
Path: '/#{path}',
Query: '#{query}',
StatusCode: 'HTTP_301'
}
}],
LoadBalancerArn: cf.ref('TaskingManagerLoadBalancer'),
Port: 80,
Protocol: 'HTTP'
}
},
TaskingManagerRDS: {
Type: 'AWS::RDS::DBInstance',
Properties: {
Engine: 'postgres',
DBName: cf.if('UseASnapshot', cf.noValue, cf.ref('PostgresDB')),
EngineVersion: '9.5.15',
MasterUsername: cf.if('UseASnapshot', cf.noValue, cf.ref('PostgresUser')),
MasterUserPassword: cf.if('UseASnapshot', cf.noValue, cf.ref('PostgresPassword')),
AllocatedStorage: cf.ref('DatabaseSize'),
StorageType: 'gp2',
DBInstanceClass: 'db.m3.large', //rethink here
DBSnapshotIdentifier: cf.if('UseASnapshot', cf.ref('DBSnapshot'), cf.noValue),
VPCSecurityGroups: [cf.importValue(cf.join('-', ['hotosm-network-production', cf.ref('Environment'), 'ec2s-security-group', cf.region]))],
}
}
};
module.exports = { Parameters, Resources, Conditions }
Effect: 'Allow',
Action: [
'logs:CreateLogStream',
'logs:PutLogEvents',
'logs:FilterLogEvents'
],
Resource: cf.getAtt(prefixed('LogGroup'), 'Arn')
},
cf.if(
'NotInChina',
{
Effect: 'Allow',
Action: 'kms:Decrypt',
Resource: cf.importValue('cloudformation-kms-production')
},
cf.noValue
)
]
}
}
]
}
};
if (!options.fifo)
Resources[prefixed('Role')].Properties.Policies[0].PolicyDocument.Statement.push({
Effect: 'Allow',
Action: 'sns:Publish',
Resource: cf.ref(prefixed('Topic'))
});
if (options.permissions)
Query: '#{query}',
StatusCode: 'HTTP_301'
}
}],
LoadBalancerArn: cf.ref('TaskingManagerLoadBalancer'),
Port: 80,
Protocol: 'HTTP'
}
},
TaskingManagerRDS: {
Type: 'AWS::RDS::DBInstance',
Properties: {
Engine: 'postgres',
DBName: cf.if('UseASnapshot', cf.noValue, cf.ref('PostgresDB')),
EngineVersion: '9.5.15',
MasterUsername: cf.if('UseASnapshot', cf.noValue, cf.ref('PostgresUser')),
MasterUserPassword: cf.if('UseASnapshot', cf.noValue, cf.ref('PostgresPassword')),
AllocatedStorage: cf.ref('DatabaseSize'),
StorageType: 'gp2',
DBInstanceClass: 'db.m3.large', //rethink here
DBSnapshotIdentifier: cf.if('UseASnapshot', cf.ref('DBSnapshot'), cf.noValue),
VPCSecurityGroups: [cf.importValue(cf.join('-', ['hotosm-network-production', cf.ref('Environment'), 'ec2s-security-group', cf.region]))],
}
}
};
module.exports = { Parameters, Resources, Conditions }
Host: '#{host}',
Path: '/#{path}',
Query: '#{query}',
StatusCode: 'HTTP_301'
}
}],
LoadBalancerArn: cf.ref('TaskingManagerLoadBalancer'),
Port: 80,
Protocol: 'HTTP'
}
},
TaskingManagerRDS: {
Type: 'AWS::RDS::DBInstance',
Properties: {
Engine: 'postgres',
DBName: cf.if('UseASnapshot', cf.noValue, cf.ref('PostgresDB')),
EngineVersion: '11.5',
MasterUsername: cf.if('UseASnapshot', cf.noValue, cf.ref('PostgresUser')),
MasterUserPassword: cf.if('UseASnapshot', cf.noValue, cf.ref('PostgresPassword')),
AllocatedStorage: cf.ref('DatabaseSize'),
BackupRetentionPeriod: 10,
StorageType: 'gp2',
DBParameterGroupName: 'tm3-logging-postgres11',
EnableCloudwatchLogsExports: ['postgresql'],
DBInstanceClass: cf.if('IsTaskingManagerProduction', 'db.t3.2xlarge', 'db.t2.small'),
DBSnapshotIdentifier: cf.if('UseASnapshot', cf.ref('DBSnapshot'), cf.noValue),
VPCSecurityGroups: [cf.importValue(cf.join('-', ['hotosm-network-production', cf.ref('NetworkEnvironment'), 'ec2s-security-group', cf.region]))],
}
}
};
module.exports = { Parameters, Resources, Conditions }