diff --git a/.web-docs/README.md b/.web-docs/README.md index 7ecdedc..04cad08 100644 --- a/.web-docs/README.md +++ b/.web-docs/README.md @@ -9,7 +9,7 @@ ### Installation -To install this plugin, copy and paste this code into your Packer configuration, then run [`packer init`](https://www.packer.io/docs/commands/init). +To install this plugin, copy and paste this code into Packer configuration, then run [`packer init`](https://www.packer.io/docs/commands/init). ```hcl packer { @@ -22,7 +22,7 @@ packer { } ``` -Alternatively, you can use `packer plugins install` to manage installation of this plugin. +Alternatively, we can use `packer plugins install` to manage installation of this plugin. ```sh $ packer plugins install github.com/QubitPi/hashicorp-aws @@ -32,5 +32,4 @@ $ packer plugins install github.com/QubitPi/hashicorp-aws #### Provisioners -- [Kong API Gateway](./provisioners/kong-api-gateway.mdx) -- [Docker Mailserver](./provisioners/docker-mailserver.mdx) +- [Sonatype Nexus Repository](./provisioners/sonatype-nexus-repository.mdx) diff --git a/.web-docs/components/provisioner/docker-mailserver/README.md b/.web-docs/components/provisioner/docker-mailserver/README.md deleted file mode 100644 index 5ff9455..0000000 --- a/.web-docs/components/provisioner/docker-mailserver/README.md +++ /dev/null @@ -1,80 +0,0 @@ - Include a short description about the provisioner. This is a good place - to call out what the provisioner does, and any additional text that might - be helpful to a user. See https://www.packer.io/docs/provisioner/null ---> - -The docker-mailserver provisioner is used to provision Packer builds for docker-mailserver AMI. - - - - -**Required** - -- `sslCertSource` (string) - The path to the local SSL certificate file to upload to the machine. The path can be - absolute or relative. If it is relative, it is relative to the working directory when Packer is executed. -- `sslCertKeySource` (string) - The path to the local SSL certificate key file to upload to the machine. The path can be - absolute or relative. If it is relative, it is relative to the working directory when Packer is executed. -- `baseDomain` (string) - The base domain name of the MX record. For example, if base domain is 'mycompany.com', the - generated MX record will be 'mail.mycompany.com' - - - -**Optional** - -- `homeDir` (string) - The `$Home` directory in AMI image; default to `/home/ubuntu` - - - -### Example Usage - -```hcl -source "amazon-ebs" "docker-mailserver" { - ami_name = "my-docker-mailserver-ami" - force_deregister = "true" - force_delete_snapshot = "true" - skip_create_ami = "false" - - instance_type = "t2.micro" - launch_block_device_mappings { - device_name = "/dev/sda1" - volume_size = 8 - volume_type = "gp2" - delete_on_termination = true - } - region = "us-east-1" - source_ami_filter { - filters = { - name = "ubuntu/images/*ubuntu-*-22.04-amd64-server-*" - root-device-type = "ebs" - virtualization-type = "hvm" - } - most_recent = true - owners = ["099720109477"] - } - ssh_username = "ubuntu" -} - -build { - name = "install-docker-mailserver" - sources = [ - "amazon-ebs.docker-mailserver" - ] - - provisioner "hashicorp-aws-docker-mailserver-provisioner" { - homeDir = "/home/ubuntu" - sslCertSource = "/abs/or/rel/path/to/ssl-cert-file" - sslCertKeySource = "/abs/or/rel/path/to/ssl-cert-key-file" - baseDomain = "mycompany.com" - } -} -``` diff --git a/.web-docs/components/provisioner/kong-api-gateway/README.md b/.web-docs/components/provisioner/kong-api-gateway/README.md deleted file mode 100644 index e980628..0000000 --- a/.web-docs/components/provisioner/kong-api-gateway/README.md +++ /dev/null @@ -1,80 +0,0 @@ - Include a short description about the provisioner. This is a good place - to call out what the provisioner does, and any additional text that might - be helpful to a user. See https://www.packer.io/docs/provisioner/null ---> - -The kong-api-gateway provisioner is used to provisioner Packer builds. - - - - -**Required** - -- `sslCertSource` (string) - The path to the local SSL certificate file to upload to the machine. The path can be - absolute or relative. If it is relative, it is relative to the working directory when Packer is executed. -- `sslCertKeySource` (string) - The path to the local SSL certificate key file to upload to the machine. The path can be - absolute or relative. If it is relative, it is relative to the working directory when Packer is executed. -- `kongApiGatewayDomain` (string) - the SSL-enabled domain that will serve the - [various ports of Kong gateway](https://qubitpi.github.io/docs.konghq.com/gateway/latest/production/networking/default-ports/) - - - -**Optional** - -- `homeDir` (string) - The `$Home` directory in AMI image; default to `/home/ubuntu` - - - -### Example Usage - -```hcl -source "amazon-ebs" "kong" { - ami_name = "my-kong-api-gateway-ami" - force_deregister = "true" - force_delete_snapshot = "true" - skip_create_ami = "false" - - instance_type = "t2.large" - launch_block_device_mappings { - device_name = "/dev/sda1" - volume_size = 8 - volume_type = "gp2" - delete_on_termination = true - } - region = "us-east-1" - source_ami_filter { - filters = { - name = "ubuntu/images/*ubuntu-*-22.04-amd64-server-*" - root-device-type = "ebs" - virtualization-type = "hvm" - } - most_recent = true - owners = ["099720109477"] - } - ssh_username = "ubuntu" -} - -build { - name = "install-kong" - sources = [ - "amazon-ebs.kong" - ] - - provisioner "hashicorp-aws-kong-api-gateway-provisioner" { - homeDir = "/home/ubuntu" - sslCertSource = "/abs/or/rel/path/to/ssl-cert-file" - sslCertKeySource = "/abs/or/rel/path/to/ssl-cert-key-file" - kongApiGatewayDomain = "mykongdomain.com" - } -} -``` diff --git a/.web-docs/components/provisioner/sonatype-nexus-repository/README.md b/.web-docs/components/provisioner/sonatype-nexus-repository/README.md new file mode 100644 index 0000000..66cb990 --- /dev/null +++ b/.web-docs/components/provisioner/sonatype-nexus-repository/README.md @@ -0,0 +1,88 @@ + Include a short description about the provisioner. This is a good place + to call out what the provisioner does, and any additional text that might + be helpful to a user. See https://www.packer.io/docs/provisioner/null +--> + +The `sonatype-nexus-repository` provisioner is used to install Sonatype Nexus Repository package in AWS AMI image + + + + +**Required** + +- `sonatypeNexusRepositoryDomain` (string) - the SSL-enabled domain that will serve the deployed HTTP Nexus instance. +- `sslCertBase64` (string) - is a __base64 encoded__ string of the content of + [SSL certificate file](https://hashicorp-aws.com/docs/setup#optional-setup-ssl) for the SSL-enabled domain, for + example `nexus.mycompany.com` given the `sonatypeNexusRepositoryDomain` is `nexus.mycompany.com`. +- `sslCertKeyBase64` (string) - is a __base64 encoded__ string of the content of + [SSL certificate key file](https://hashicorp-aws.com/docs/setup#optional-setup-ssl) for the SSL-enabled domain, for + example `nexus.mycompany.com` given the `sonatypeNexusRepositoryDomain` is `nexus.mycompany.com`. + + + +**Optional** + +- `homeDir` (string) - The `$Home` directory in AMI image; default to `/home/ubuntu` + + + +### Example Usage + +```hcl +packer { + required_plugins { + amazon = { + version = ">= 0.0.2" + source = "github.com/hashicorp/amazon" + } + } +} + +source "amazon-ebs" "hashicorp-aws" { + ami_name = "packer-plugin-hashicorp-aws-acc-test-ami" + force_deregister = "true" + force_delete_snapshot = "true" + + instance_type = "t2.micro" + launch_block_device_mappings { + device_name = "/dev/sda1" + volume_size = 8 + volume_type = "gp2" + delete_on_termination = true + } + region = "us-west-1" + source_ami_filter { + filters = { + name = "ubuntu/images/*ubuntu-*-22.04-amd64-server-*" + root-device-type = "ebs" + virtualization-type = "hvm" + } + most_recent = true + owners = ["099720109477"] + } + ssh_username = "ubuntu" +} + +build { + sources = [ + "source.amazon-ebs.hashicorp-aws" + ] + + provisioner "hashicorp-aws-sonatype-nexus-repository-provisioner" { + homeDir = "/home/ubuntu" + sslCertBase64 = "YXNkZnNnaHRkeWhyZXJ3ZGZydGV3ZHNmZ3RoeTY0cmV3ZGZyZWd0cmV3d2ZyZw==" + sslCertKeyBase64 = "MzI0NXRnZjk4dmJoIGNsO2VbNDM1MHRdzszNDM1b2l0cmo=" + sonatypeNexusRepositoryDomain = "nexus.mycompany.com" + } +} +``` diff --git a/docs/README.md b/docs/README.md index 7ecdedc..04cad08 100644 --- a/docs/README.md +++ b/docs/README.md @@ -9,7 +9,7 @@ ### Installation -To install this plugin, copy and paste this code into your Packer configuration, then run [`packer init`](https://www.packer.io/docs/commands/init). +To install this plugin, copy and paste this code into Packer configuration, then run [`packer init`](https://www.packer.io/docs/commands/init). ```hcl packer { @@ -22,7 +22,7 @@ packer { } ``` -Alternatively, you can use `packer plugins install` to manage installation of this plugin. +Alternatively, we can use `packer plugins install` to manage installation of this plugin. ```sh $ packer plugins install github.com/QubitPi/hashicorp-aws @@ -32,5 +32,4 @@ $ packer plugins install github.com/QubitPi/hashicorp-aws #### Provisioners -- [Kong API Gateway](./provisioners/kong-api-gateway.mdx) -- [Docker Mailserver](./provisioners/docker-mailserver.mdx) +- [Sonatype Nexus Repository](./provisioners/sonatype-nexus-repository.mdx) diff --git a/docs/provisioners/docker-mailserver.mdx b/docs/provisioners/docker-mailserver.mdx deleted file mode 100644 index 044e02d..0000000 --- a/docs/provisioners/docker-mailserver.mdx +++ /dev/null @@ -1,83 +0,0 @@ -Type: `docker-mailserver` - - - -The docker-mailserver provisioner is used to provision Packer builds for docker-mailserver AMI. - - - - -**Required** - -- `sslCertSource` (string) - The path to the local SSL certificate file to upload to the machine. The path can be - absolute or relative. If it is relative, it is relative to the working directory when Packer is executed. -- `sslCertKeySource` (string) - The path to the local SSL certificate key file to upload to the machine. The path can be - absolute or relative. If it is relative, it is relative to the working directory when Packer is executed. -- `baseDomain` (string) - The base domain name of the MX record. For example, if base domain is 'mycompany.com', the - generated MX record will be 'mail.mycompany.com' - - - -**Optional** - -- `homeDir` (string) - The `$Home` directory in AMI image; default to `/home/ubuntu` - - - -### Example Usage - -```hcl -source "amazon-ebs" "docker-mailserver" { - ami_name = "my-docker-mailserver-ami" - force_deregister = "true" - force_delete_snapshot = "true" - skip_create_ami = "false" - - instance_type = "t2.micro" - launch_block_device_mappings { - device_name = "/dev/sda1" - volume_size = 8 - volume_type = "gp2" - delete_on_termination = true - } - region = "us-east-1" - source_ami_filter { - filters = { - name = "ubuntu/images/*ubuntu-*-22.04-amd64-server-*" - root-device-type = "ebs" - virtualization-type = "hvm" - } - most_recent = true - owners = ["099720109477"] - } - ssh_username = "ubuntu" -} - -build { - name = "install-docker-mailserver" - sources = [ - "amazon-ebs.docker-mailserver" - ] - - provisioner "hashicorp-aws-docker-mailserver-provisioner" { - homeDir = "/home/ubuntu" - sslCertSource = "/abs/or/rel/path/to/ssl-cert-file" - sslCertKeySource = "/abs/or/rel/path/to/ssl-cert-key-file" - baseDomain = "mycompany.com" - } -} -``` diff --git a/docs/provisioners/kong-api-gateway.mdx b/docs/provisioners/kong-api-gateway.mdx deleted file mode 100644 index c785aaf..0000000 --- a/docs/provisioners/kong-api-gateway.mdx +++ /dev/null @@ -1,83 +0,0 @@ -Type: `kong-api-gateway` - - - -The kong-api-gateway provisioner is used to provisioner Packer builds. - - - - -**Required** - -- `sslCertSource` (string) - The path to the local SSL certificate file to upload to the machine. The path can be - absolute or relative. If it is relative, it is relative to the working directory when Packer is executed. -- `sslCertKeySource` (string) - The path to the local SSL certificate key file to upload to the machine. The path can be - absolute or relative. If it is relative, it is relative to the working directory when Packer is executed. -- `kongApiGatewayDomain` (string) - the SSL-enabled domain that will serve the - [various ports of Kong gateway](https://qubitpi.github.io/docs.konghq.com/gateway/latest/production/networking/default-ports/) - - - -**Optional** - -- `homeDir` (string) - The `$Home` directory in AMI image; default to `/home/ubuntu` - - - -### Example Usage - -```hcl -source "amazon-ebs" "kong" { - ami_name = "my-kong-api-gateway-ami" - force_deregister = "true" - force_delete_snapshot = "true" - skip_create_ami = "false" - - instance_type = "t2.large" - launch_block_device_mappings { - device_name = "/dev/sda1" - volume_size = 8 - volume_type = "gp2" - delete_on_termination = true - } - region = "us-east-1" - source_ami_filter { - filters = { - name = "ubuntu/images/*ubuntu-*-22.04-amd64-server-*" - root-device-type = "ebs" - virtualization-type = "hvm" - } - most_recent = true - owners = ["099720109477"] - } - ssh_username = "ubuntu" -} - -build { - name = "install-kong" - sources = [ - "amazon-ebs.kong" - ] - - provisioner "hashicorp-aws-kong-api-gateway-provisioner" { - homeDir = "/home/ubuntu" - sslCertSource = "/abs/or/rel/path/to/ssl-cert-file" - sslCertKeySource = "/abs/or/rel/path/to/ssl-cert-key-file" - kongApiGatewayDomain = "mykongdomain.com" - } -} -``` diff --git a/docs/provisioners/sonatype-nexus-repository.mdx b/docs/provisioners/sonatype-nexus-repository.mdx new file mode 100644 index 0000000..e0a44c2 --- /dev/null +++ b/docs/provisioners/sonatype-nexus-repository.mdx @@ -0,0 +1,91 @@ +Type: `sonatypeNexusRepository` + + + +The `sonatype-nexus-repository` provisioner is used to install Sonatype Nexus Repository package in AWS AMI image + + + + +**Required** + +- `sonatypeNexusRepositoryDomain` (string) - the SSL-enabled domain that will serve the deployed HTTP Nexus instance. +- `sslCertBase64` (string) - is a __base64 encoded__ string of the content of + [SSL certificate file](https://hashicorp-aws.com/docs/setup#optional-setup-ssl) for the SSL-enabled domain, for + example `nexus.mycompany.com` given the `sonatypeNexusRepositoryDomain` is `nexus.mycompany.com`. +- `sslCertKeyBase64` (string) - is a __base64 encoded__ string of the content of + [SSL certificate key file](https://hashicorp-aws.com/docs/setup#optional-setup-ssl) for the SSL-enabled domain, for + example `nexus.mycompany.com` given the `sonatypeNexusRepositoryDomain` is `nexus.mycompany.com`. + + + +**Optional** + +- `homeDir` (string) - The `$Home` directory in AMI image; default to `/home/ubuntu` + + + +### Example Usage + +```hcl +packer { + required_plugins { + amazon = { + version = ">= 0.0.2" + source = "github.com/hashicorp/amazon" + } + } +} + +source "amazon-ebs" "hashicorp-aws" { + ami_name = "packer-plugin-hashicorp-aws-acc-test-ami" + force_deregister = "true" + force_delete_snapshot = "true" + + instance_type = "t2.micro" + launch_block_device_mappings { + device_name = "/dev/sda1" + volume_size = 8 + volume_type = "gp2" + delete_on_termination = true + } + region = "us-west-1" + source_ami_filter { + filters = { + name = "ubuntu/images/*ubuntu-*-22.04-amd64-server-*" + root-device-type = "ebs" + virtualization-type = "hvm" + } + most_recent = true + owners = ["099720109477"] + } + ssh_username = "ubuntu" +} + +build { + sources = [ + "source.amazon-ebs.hashicorp-aws" + ] + + provisioner "hashicorp-aws-sonatype-nexus-repository-provisioner" { + homeDir = "/home/ubuntu" + sslCertBase64 = "YXNkZnNnaHRkeWhyZXJ3ZGZydGV3ZHNmZ3RoeTY0cmV3ZGZyZWd0cmV3d2ZyZw==" + sslCertKeyBase64 = "MzI0NXRnZjk4dmJoIGNsO2VbNDM1MHRdzszNDM1b2l0cmo=" + sonatypeNexusRepositoryDomain = "nexus.mycompany.com" + } +} +```