terraform-aws-artifactory-oss

terraform-aws-artifactory-oss

Build Status Latest Release GitHub tag (latest SemVer) Terraform VersionInfrastructure Tests pre-commit checkov Infrastructure Tests

Terraform module –


It’s 100% Open Source and licensed under the APACHE2.

Usage

This is just a very basic example using Bitnamis AMI.

alt text

Copy the example or just include module.art.tf from this repository as a module in your existing Terraform code:

module "art" {
  source             = "JamesWoolfenden/artifactory-oss/aws"
  version            = "0.1.0"
  common_tags        = var.common_tags
  instance_type      = var.instance_type
  key_name           = var.key_name
  vpc_id             = var.vpc_id
  ssl_certificate_id = var.ssl_certificate_id
  sec_group_name     = var.sec_group_name
  allowed_cidr       = var.allowed_cidr
  subnet_id          = var.subnet_id
  ssh_cidr           = var.ssh_cidr
  record             = var.record
  zone_id            = var.zone_id
}

Costs

Monthly cost estimate

Project: .

 Name                                                 Monthly Qty  Unit         Monthly Cost

 module.art.aws_elb.service_elb
 ├─ Classic load balancer                                     730  hours              $21.46
 └─ Data processed                                    Cost depends on usage: $0.0084 per GB

 module.art.aws_instance.art
 ├─ Instance usage (Linux/UNIX, on-demand, t2.small)          730  hours              $18.98
 ├─ EC2 detailed monitoring                                     7  metrics             $2.10
 └─ root_block_device
    └─ Storage (general purpose SSD, gp2)                     100  GB-months          $11.60

 PROJECT TOTAL                                                                        $54.14

Requirements

No requirements.

Providers

Name Version
aws n/a
local n/a
tls n/a

Modules

No modules.

Resources

Name Type
aws_elb.service_elb resource
aws_instance.art resource
aws_key_pair.art resource
aws_route53_record.www resource
aws_security_group.art resource
aws_security_group.elb resource
local_file.private_ssh resource
local_file.public_ssh resource
tls_private_key.ssh resource
aws_ami.art data source
aws_ebs_default_kms_key.current data source

Inputs

Name Description Type Default Required
allowed_cidr n/a list(any) n/a yes
common_tags Implements the common_tags scheme map(any) n/a yes
instance_type Instance type for your Artifactory instance string "t2.small" no
key_name n/a string n/a yes
record The DNS name for Route53 string n/a yes
sec_group_name n/a string n/a yes
ssh_cidr n/a list(any) n/a yes
ssl_certificate_id Your SSL certificate ID from ACM to add to your Load balancer string n/a yes
subnet_id Your Subnets… string n/a yes
vpc_id n/a string n/a yes
zone_id The ZOne to use for your DNS record string n/a yes

Outputs

Name Description
elb n/a
instance n/a
record n/a

Policy

The Terraform resource required is:

resource "aws_iam_policy" "terraform_pike" {
  name_prefix = "terraform_pike"
  path        = "https://github.com/"
  description = "Pike Autogenerated policy from IAC"

  policy = jsonencode({
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": [
                "ec2:AuthorizeSecurityGroupEgress",
                "ec2:AuthorizeSecurityGroupIngress",
                "ec2:CreateKeyPair",
                "ec2:CreateSecurityGroup",
                "ec2:CreateTags",
                "ec2:DeleteKeyPair",
                "ec2:DeleteSecurityGroup",
                "ec2:DeleteTags",
                "ec2:DescribeAccountAttributes",
                "ec2:DescribeImages",
                "ec2:DescribeInstanceAttribute",
                "ec2:DescribeInstanceCreditSpecifications",
                "ec2:DescribeInstanceTypes",
                "ec2:DescribeInstances",
                "ec2:DescribeKeyPairs",
                "ec2:DescribeNetworkInterfaces",
                "ec2:DescribeSecurityGroups",
                "ec2:DescribeTags",
                "ec2:DescribeVolumes",
                "ec2:GetEbsDefaultKmsKeyId",
                "ec2:ImportKeyPair",
                "ec2:ModifyInstanceAttribute",
                "ec2:MonitorInstances",
                "ec2:RevokeSecurityGroupEgress",
                "ec2:RevokeSecurityGroupIngress",
                "ec2:RunInstances",
                "ec2:StartInstances",
                "ec2:StopInstances",
                "ec2:TerminateInstances",
                "ec2:UnmonitorInstances"
            ],
            "Resource": "*"
        },
        {
            "Sid": "VisualEditor1",
            "Effect": "Allow",
            "Action": [
                "elasticloadbalancing:AddTags",
                "elasticloadbalancing:AttachLoadBalancerToSubnets",
                "elasticloadbalancing:CreateLoadBalancer",
                "elasticloadbalancing:CreateLoadBalancerListeners",
                "elasticloadbalancing:DeleteLoadBalancer",
                "elasticloadbalancing:DescribeLoadBalancerAttributes",
                "elasticloadbalancing:DescribeLoadBalancers",
                "elasticloadbalancing:DescribeTags",
                "elasticloadbalancing:ModifyLoadBalancerAttributes",
                "elasticloadbalancing:RemoveTags"
            ],
            "Resource": "*"
        },
        {
            "Sid": "VisualEditor2",
            "Effect": "Allow",
            "Action": [
                "route53:ChangeResourceRecordSets",
                "route53:GetChange",
                "route53:GetHostedZone",
                "route53:ListResourceRecordSets"
            ],
            "Resource": "*"
        }
    ]
})
}

Related Projects

Check out these related projects.

Help

Got a question?

File a GitHub issue.

Contributing

Bug Reports & Feature Requests

Please use the issue tracker to report any bugs or file feature requests.

Copyrights

Copyright © 2019-2022 James Woolfenden

License

License

See LICENSE for full details.

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Contributors

James Woolfenden
James Woolfenden

Visit original content creator repository https://github.com/JamesWoolfenden/terraform-aws-artifactory-oss

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *