This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/********************************************************************************************* | |
* Returns a copy of "input" without the characters that exist inside the "setOfCharacters". | |
* It does the work in a case insensitive mode. | |
* Example: "Hello World!" with "setOfCharacters" being "oe", returns "Hll Wrld!". | |
* | |
* @param input | |
* @param setOfCharacters | |
* @returns String | |
*/ | |
function squeeze(input, setOfCharacters) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe('squeeze function', function () { | |
context('when string is "Hello World!" and set of characters is "oe"', function () { | |
var input = "Hello World!"; | |
var setOfCharacters = "oe"; | |
var result = "Hll Wrld!"; | |
it('should return "' + result + '"', function () { | |
expect(squeeze(input, setOfCharacters)).toBe(result); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/********************************************************************************************* | |
* Returns a copy of "input" without the characters that exist inside the "setOfCharacters". | |
* It does the work in a case insensitive mode. | |
* Example: "Hello World!" with "setOfCharacters" being "oe", returns "Hll Wrld!". | |
* | |
* @param input | |
* @param setOfCharacters | |
* @returns String | |
*/ | |
function squeeze(input, setOfCharacters) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
context = describe; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe('squeeze function', function () { | |
context('when string is "Hello World!" and set of characters is "oe"', function () { | |
var input = "Hello World!"; | |
var setOfCharacters = "oe"; | |
it('should return "Hll Wrld!"', function () { | |
var result = "Hll Wrld!"; | |
expect(squeeze(input, setOfCharacters)).toBe(result); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "aws_cloudwatch_log_group" "s3_sink_msk_connector" { | |
name = "${var.project}-s3-sink-msk-connector" | |
tags = { | |
"environment" = var.environment | |
"Name" = "${var.project}-cloudwatch-log-group-for-s3-sink-msk-connector" | |
"project" = var.project | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"title": "Practical Terraform & AWS" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data "aws_ami" "client" { | |
most_recent = true | |
filter { | |
name = "architecture" | |
values = ["x86_64"] | |
} | |
filter { | |
name = "block-device-mapping.delete-on-termination" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "aws_iam_role" "ecs_task_execution" { | |
name = "${var.project}-ECSTaskExecRole" | |
assume_role_policy = jsonencode({ | |
Version = "2012-10-17" | |
Statement = [ | |
{ | |
Effect = "Allow", | |
Principal = { | |
Service = "ecs-tasks.amazonaws.com" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
variable "company_name" { | |
type = string | |
description = "This is going to be used as a prefix before the project name for resources that require a global naming uniqueness, like S3." | |
nullable = false | |
} | |
variable "project" { | |
type = string | |
description = "The name of this project, like 'msk-demo' will be used as prefix name accross many resources." | |
default = "msk-demo" |