diff --git a/aws/infracost-usage.yml b/aws/cloudformation/infracost-usage.yml similarity index 100% rename from aws/infracost-usage.yml rename to aws/cloudformation/infracost-usage.yml diff --git a/aws/cloudformation/template.yml b/aws/cloudformation/template.yml new file mode 100644 index 0000000..db537bd --- /dev/null +++ b/aws/cloudformation/template.yml @@ -0,0 +1,93 @@ +AWSTemplateFormatVersion: '2010-09-09' +Description: 'Converted from Terraform configuration' + +Resources: + MyWebApp: + Type: AWS::EC2::Instance + Properties: + ImageId: ami-005e54dee72cc1d00 + InstanceType: m3.xlarge + BlockDeviceMappings: + - DeviceName: /dev/xvda + Ebs: + VolumeSize: 1000 + DeleteOnTermination: true + Tags: + - Key: Environment + Value: production + - Key: Service + Value: web-app + + MyHelloWorld: + Type: AWS::Lambda::Function + Properties: + FunctionName: test + Role: arn:aws:iam::123123123123:role/lambda-execution-role + MemorySize: 512 + ImageUri: test + PackageType: Image + Tags: + - Key: Environment + Value: Prod + + NewWebApp: + Type: AWS::EC2::Instance + Properties: + ImageId: ami-005e54dee72cc1d00 + InstanceType: m3.2xlarge + BlockDeviceMappings: + - DeviceName: /dev/xvda + Ebs: + VolumeSize: 100 + VolumeType: gp3 + DeleteOnTermination: true + - DeviceName: /dev/sdb + Ebs: + VolumeSize: 100 + VolumeType: gp3 + Iops: 20000 + Tags: + - Key: Environment + Value: prod + - Key: Service + Value: web-app + + NewWebAppRootVolume: + Type: AWS::EC2::Volume + Properties: + Size: 100 + VolumeType: gp2 + AvailabilityZone: us-east-1a + Tags: + - Key: Environment + Value: production + + NewWebAppVolumeAttachment: + Type: AWS::EC2::VolumeAttachment + Properties: + Device: /dev/sdc + InstanceId: !Ref NewWebApp + VolumeId: !Ref NewWebAppRootVolume + + MyDB: + Type: AWS::RDS::DBInstance + Properties: + DBInstanceIdentifier: mydb + AllocatedStorage: 20 + StorageType: gp3 + Engine: postgres + EngineVersion: '11.13' + DBInstanceClass: db.t4g.medium + DBName: mydb + MasterUsername: admin + MasterUserPassword: mypassword + DBParameterGroupName: default.postgres11 + MultiAZ: false + BackupRetentionPeriod: 7 + PubliclyAccessible: false + Tags: + - Key: Environment + Value: production + - Key: Service + Value: web-app + DeletionPolicy: Delete \ No newline at end of file diff --git a/aws/terraform/infracost-usage.yml b/aws/terraform/infracost-usage.yml new file mode 100644 index 0000000..1ca656f --- /dev/null +++ b/aws/terraform/infracost-usage.yml @@ -0,0 +1,10 @@ +# You can use this file to define resource usage estimates for Infracost to use when calculating +# the cost of usage-based resource, such as AWS S3 or Lambda. +# `infracost breakdown --path=. --usage-file=infracost-usage.yml [other flags]` +# See https://infracost.io/usage-file/ for docs +version: 0.1 +# The following usage values apply to each resource of the given type, which is useful when you want to define defaults. +resource_type_default_usage: + aws_lambda_function: + monthly_requests: 20000000 # Monthly requests to the Lambda function. + request_duration_ms: 350 # Average duration of each request in milliseconds. diff --git a/aws/main.tf b/aws/terraform/main.tf similarity index 100% rename from aws/main.tf rename to aws/terraform/main.tf