Hi, guys I'm having an error "The parameter groupName cannot be used with the pa . . .

Vishv Deshwal:
Hi, guys I’m having an error
“The parameter groupName cannot be used with the parameter subnet” with my auto-scaling group, I’ve searched it every where, I haven’t found any solution. Please help

Alistair Mackay:
How are you trying to create it? CloudFormation, Terraform?
You need to show us the the script.

Vishv Deshwal:
I really appreciate your willingness to assist.
I’m referring the git repo in this message, please help me to evade two errors, one is I have mentioned and the other one is for rds incompatible engine and version, I’m stuck on this for last 2 days
https://github.com/sheersagar/full-scale-tier3-arch-tf/tree/master

Please try to run the code in your system as well and correct me in every possible manner that you can.

Alistair Mackay:
Please also paste the error messages you are receiving from terraform (the text please, not a screenshot)

Vishv Deshwal:
The error says
"creating Auto Scaling Group (demo-asg): ValidationError: You must use a valid fully-formed launch template. The parameter groupName cannot be used with the parameter subnet
│ status code: 400, request id: dcb0d3f5-7c33-4270-afe0-1532cf0b4181

│ with aws_autoscaling_group.asg_demo,
│ on http://asg.tf|asg.tf line 3, in resource “aws_autoscaling_group” “asg_demo”:
│ 3: resource “aws_autoscaling_group” “asg_demo” {



│ Error: creating RDS Cluster (tf-20231008141535761800000001): InvalidParameterCombination: The combination of engine version 8.0.34 and DB instance class db.t3.large isn’t supported for Multi-AZ DB clusters.
│ status code: 400, request id: f33586ad-cecb-46e2-af11-4c87dc1cb404

│ with aws_rds_cluster.rds_cluster,
│ on http://rds.tf|rds.tf line 21, in resource “aws_rds_cluster” “rds_cluster”:
│ 21: resource “aws_rds_cluster” “rds_cluster” {
"

And one more point, I’m unable to put the value of subnets in .tfvars file as hard coded value once they are created, I tried my level best so that terraform will automatically put the subnet id into the .tfvars file. Because in the middle of the running the terraform it showed error that it could not able to find subnet ids, so that I have to go to aws account and copy all the subnet ids one by one and paste it there, thereafter had to run terraform apply command once again.

Then this error came which is mentioned above.

Vishv Deshwal:
I’m only able to put the value** Correction

Vishv Deshwal:
These were the errors when I failed to make terraform fill subnet ids automatically in .tfvar file

│ Error: creating Auto Scaling Group (demo-asg): ValidationError: You must use a valid fully-formed launch template. The parameter groupName cannot be used with the parameter subnet
│ status code: 400, request id: 1ba25e99-087f-4984-8478-97a13100d93d

│ with aws_autoscaling_group.asg_demo,
│ on http://asg.tf|asg.tf line 3, in resource “aws_autoscaling_group” “asg_demo”:
│ 3: resource “aws_autoscaling_group” “asg_demo” {



│ Error: reading EC2 Subnet (subnet-0df5804df202189ca): couldn’t find resource

│ with aws_efs_mount_target.efs_mount[2],
│ on http://efs.tf|efs.tf line 18, in resource “aws_efs_mount_target” “efs_mount”:
│ 18: resource “aws_efs_mount_target” “efs_mount” {



│ Error: reading EC2 Subnet (subnet-084253b232e47dfd2): couldn’t find resource

│ with aws_efs_mount_target.efs_mount[0],
│ on http://efs.tf|efs.tf line 18, in resource “aws_efs_mount_target” “efs_mount”:
│ 18: resource “aws_efs_mount_target” “efs_mount” {



│ Error: reading EC2 Subnet (subnet-072ee4be3058cb25c): couldn’t find resource

│ with aws_efs_mount_target.efs_mount[1],
│ on http://efs.tf|efs.tf line 18, in resource “aws_efs_mount_target” “efs_mount”:
│ 18: resource “aws_efs_mount_target” “efs_mount” {



│ Error: creating ELBv2 application Load Balancer (LB-Demo): SubnetNotFound: InvalidSubnetID.NotFound
│ status code: 400, request id: b0f2c6b2-d911-44be-b6e3-f58935bea6a7

│ with http://aws_lb.lb|aws_lb.lb,
│ on http://lb.tf|lb.tf line 4, in resource “aws_lb” “lb”:
│ 4: resource “aws_lb” “lb” {



│ Error: creating RDS DB Subnet Group (demo-rds-subnet-group): InvalidParameterValue: Some input subnets in :[subnet-030ab52699f9e8dba, subnet-083da77277169c505, subnet-0e244030e8a9ed152] are invalid.
│ status code: 400, request id: 6448ba2c-00e9-4c29-91a8-b6634535cec6

│ with aws_db_subnet_group.db_sn_group,
│ on http://rds.tf|rds.tf line 3, in resource “aws_db_subnet_group” “db_sn_group”:
│ 3: resource “aws_db_subnet_group” “db_sn_group” {

Then had to put all the values of subnet id by copying one by one, this was solved after doing that, I will appreciate your assistance in this part as well.

Alistair Mackay:
It is going to take me a long time to go through all of this.
Also, you should not put state files into git repos. They contain potentially sensitive information.
Always have a .gitignore file with at least the following content

terraform.tfstate*
.terraform/

The second entry prevents you from accidentally committing all the providers.

Vishv Deshwal:
Thank you for this vital point.
I appreciate you that you are giving me your most valuable thing (time).
I’ll be eagerly waiting for your response.

Alistair Mackay:
First issue

#############################################################################
# SUBNET IDs
#############################################################################

subnet_ids_pb_sn = [
    "subnet-0b1c4af9e87df5136",
    "subnet-0831f92674766cc10",
    "subnet-0824128e2316de411"
]

subnet_ids_pvt_sn_app = [
    "subnet-084253b232e47dfd2",
    "subnet-072ee4be3058cb25c",
    "subnet-0df5804df202189ca"
]

subnet_ids_pvt_sn_db = [
    "subnet-083da77277169c505",
    "subnet-0e244030e8a9ed152",
    "subnet-030ab52699f9e8dba"
]

You cannot know the subnet IDs here. You are creating a new VPC and subnets, therefore you must take subnet IDs from the subnet resources you are creating.

Alistair Mackay:
To clean up the state files in the repo

  1. Delete the state and state backup - ensure you have done terraform destroy before zapping any state file
  2. Commit the delete
  3. Create .gitignore
  4. Commit that

Vishv Deshwal:
That is correct, I couldn’t able to figure out as to how should I put the subnet ids so that terraform would automatically fill them once they are created.
Right now I’m not having access to my system, I’ll be there with my system in the morning once I reach home. I’ll surely be able to do it in the morning.
Please point out further more issues. :v:

Alistair Mackay:
I have forked your repo as there is much to fix in here. I will send a PR with changes when it works.

Vishv Deshwal:
Perfect. That will be amazing. I will be looking for it as soon as possible.

Alistair Mackay:
Are you specifically wanting to create an Aurora cluster, or simply a Multi-AZ RDS instance?

Alistair Mackay:
Also, if you build a multi-az cluster then this applies:

• Multi-AZ DB clusters only support Provisioned IOPS storage.
That is $$$$$

Alistair Mackay:
I think we should use aws_db_instance with multi-az enabled.

Alistair Mackay:
https://github.com/sheersagar/full-scale-tier3-arch-tf/pull/1

Vishv Deshwal:
I’m really happy and I appreciate your efforts in this, I’ll take my time to process all the changes you’ve done.
Thanks a ton Mackay, I’ll reconnect with you, if I have any confusion in getting any of the changes made by you.
This is the most detailed explanation that I could have ever got. Thanks again. _/_

Alistair Mackay:
I added a couple more commits just now