Skip to content
Snippets Groups Projects
Commit 23661f79 authored by Kenneth's avatar Kenneth
Browse files

Last changes

parent 8ce2ccd0
No related branches found
No related tags found
No related merge requests found
...@@ -5,6 +5,7 @@ from psycopg2 import sql ...@@ -5,6 +5,7 @@ from psycopg2 import sql
# Informations de connexion à PostgreSQL # Informations de connexion à PostgreSQL
host = "localhost" # ou l'adresse de votre serveur host = "localhost" # ou l'adresse de votre serveur
#host = "kennethhugo-dev-rds-instance.cx4q20s8stp5.eu-west-3.rds.amazonaws.com"
port = 5432 # port par défaut de PostgreSQL port = 5432 # port par défaut de PostgreSQL
user = "postgres" # utilisateur PostgreSQL user = "postgres" # utilisateur PostgreSQL
password = "mysecretpassword" # mot de passe PostgreSQL password = "mysecretpassword" # mot de passe PostgreSQL
...@@ -44,6 +45,7 @@ app = Flask(__name__, template_folder ="templates") ...@@ -44,6 +45,7 @@ app = Flask(__name__, template_folder ="templates")
# Configuration de la base de données PostgreSQL # Configuration de la base de données PostgreSQL
app.config['SQLALCHEMY_DATABASE_URI'] = 'postgresql://postgres:mysecretpassword@localhost:5432/mydb' app.config['SQLALCHEMY_DATABASE_URI'] = 'postgresql://postgres:mysecretpassword@localhost:5432/mydb'
#app.config['SQLALCHEMY_DATABASE_URI'] = 'postgresql://postgres:mysecretpassword@kennethhugo-dev-rds-instance.cx4q20s8stp5.eu-west-3.rds.amazonaws.com:5432/mydb'
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
db = SQLAlchemy(app) db = SQLAlchemy(app)
...@@ -156,5 +158,5 @@ def purchase_ephone(): ...@@ -156,5 +158,5 @@ def purchase_ephone():
if __name__ == '__main__': if __name__ == '__main__':
app.run(debug=True) app.run(debug=True,host ='0.0.0.0',port=5000)
No preview for this file type
...@@ -126,13 +126,23 @@ resource "aws_security_group" "sg_client" { ...@@ -126,13 +126,23 @@ resource "aws_security_group" "sg_client" {
security_groups = [data.aws_security_group.bastion.id] security_groups = [data.aws_security_group.bastion.id]
//cidr_blocks = [] //cidr_blocks = []
}
ingress {
description = "Allow SSH from anywhere"
from_port = 22
to_port = 22
protocol = "tcp"
security_groups = [data.aws_security_group.bastion.id]
//cidr_blocks = []
} }
# Autorise l'API en sortie # Autorise l'API en sortie
egress { egress {
from_port = 80 from_port = 5000
to_port = 80 to_port = 5000
protocol = "tcp" protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
} }
tags = { tags = {
......
{"ID":"b65770f0-f6c2-ae59-3342-df85f35d930b","Operation":"OperationTypeApply","Info":"","Who":"kenneth@MLG","Version":"1.10.5","Created":"2025-01-30T16:55:27.773921195Z","Path":"terraform.tfstate.d/DEV/terraform.tfstate"}
\ No newline at end of file
{ {
"version": 4, "version": 4,
"terraform_version": "1.10.5", "terraform_version": "1.10.5",
"serial": 240, "serial": 249,
"lineage": "eded4345-a67f-9a4a-9ad8-c68c205f47c2", "lineage": "eded4345-a67f-9a4a-9ad8-c68c205f47c2",
"outputs": {}, "outputs": {},
"resources": [ "resources": [
...@@ -169,7 +169,7 @@ ...@@ -169,7 +169,7 @@
"assign_ipv6_address_on_creation": false, "assign_ipv6_address_on_creation": false,
"availability_zone": "eu-west-3a", "availability_zone": "eu-west-3a",
"availability_zone_id": "euw3-az1", "availability_zone_id": "euw3-az1",
"available_ip_address_count": 241, "available_ip_address_count": 245,
"cidr_block": "10.0.1.0/24", "cidr_block": "10.0.1.0/24",
"customer_owned_ipv4_pool": "", "customer_owned_ipv4_pool": "",
"default_for_az": false, "default_for_az": false,
...@@ -219,7 +219,7 @@ ...@@ -219,7 +219,7 @@
"assign_ipv6_address_on_creation": false, "assign_ipv6_address_on_creation": false,
"availability_zone": "eu-west-3b", "availability_zone": "eu-west-3b",
"availability_zone_id": "euw3-az2", "availability_zone_id": "euw3-az2",
"available_ip_address_count": 246, "available_ip_address_count": 248,
"cidr_block": "10.0.2.0/24", "cidr_block": "10.0.2.0/24",
"customer_owned_ipv4_pool": "", "customer_owned_ipv4_pool": "",
"default_for_az": false, "default_for_az": false,
...@@ -432,11 +432,11 @@ ...@@ -432,11 +432,11 @@
"deletion_protection": false, "deletion_protection": false,
"domain": "", "domain": "",
"domain_auth_secret_arn": "", "domain_auth_secret_arn": "",
"domain_dns_ips": null, "domain_dns_ips": [],
"domain_fqdn": "", "domain_fqdn": "",
"domain_iam_role_name": "", "domain_iam_role_name": "",
"domain_ou": "", "domain_ou": "",
"enabled_cloudwatch_logs_exports": null, "enabled_cloudwatch_logs_exports": [],
"endpoint": "kennethhugo-dev-rds-instance.cx4q20s8stp5.eu-west-3.rds.amazonaws.com:5432", "endpoint": "kennethhugo-dev-rds-instance.cx4q20s8stp5.eu-west-3.rds.amazonaws.com:5432",
"engine": "postgres", "engine": "postgres",
"engine_lifecycle_support": "open-source-rds-extended-support", "engine_lifecycle_support": "open-source-rds-extended-support",
...@@ -856,7 +856,7 @@ ...@@ -856,7 +856,7 @@
"key_pair_id": "key-0dc72c68c6af39fbb", "key_pair_id": "key-0dc72c68c6af39fbb",
"key_type": "rsa", "key_type": "rsa",
"public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCdgUoVRIPCQHlBoaz6UfrvQ4gw2sxeV3PIgCmCSXUW+I9beSfrBs4ELbiuUsV33Y8rKRNQBxa60+J0bEwNtIXRARN7bfdVmukoIJ/LBPcj1XzjmcVE4RJCxSRQbiMYnbUG6Ps5m1sMXsGf0WoPuXIsYoRKHa4QtcqSqqm/G/BW4a0Kvwdfww2dYCKhNoniSPAnDGPowQpGzTc3nvO/ED7polY9T1b6kqaw5WSCWic/qUfgJ2Lxn+bus72vgelhqZhFSqJgTL2e3xPmqtmrUO/4U2kjF3YH120syEfvQFIg/PozQqfkupbDPB1Cx7/1ThZLpJT5Dv1I/kCuZQuNNZj7", "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCdgUoVRIPCQHlBoaz6UfrvQ4gw2sxeV3PIgCmCSXUW+I9beSfrBs4ELbiuUsV33Y8rKRNQBxa60+J0bEwNtIXRARN7bfdVmukoIJ/LBPcj1XzjmcVE4RJCxSRQbiMYnbUG6Ps5m1sMXsGf0WoPuXIsYoRKHa4QtcqSqqm/G/BW4a0Kvwdfww2dYCKhNoniSPAnDGPowQpGzTc3nvO/ED7polY9T1b6kqaw5WSCWic/qUfgJ2Lxn+bus72vgelhqZhFSqJgTL2e3xPmqtmrUO/4U2kjF3YH120syEfvQFIg/PozQqfkupbDPB1Cx7/1ThZLpJT5Dv1I/kCuZQuNNZj7",
"tags": null, "tags": {},
"tags_all": {} "tags_all": {}
}, },
"sensitive_attributes": [], "sensitive_attributes": [],
...@@ -877,7 +877,21 @@ ...@@ -877,7 +877,21 @@
"description": "ec2 Security Group", "description": "ec2 Security Group",
"egress": [], "egress": [],
"id": "sg-0c5ea597dc0f43e11", "id": "sg-0c5ea597dc0f43e11",
"ingress": [], "ingress": [
{
"cidr_blocks": [],
"description": "",
"from_port": 22,
"ipv6_cidr_blocks": [],
"prefix_list_ids": [],
"protocol": "tcp",
"security_groups": [
"sg-0a7ccf14d1b6468fa"
],
"self": false,
"to_port": 22
}
],
"name": "KENNETHHUGO_SG_EC2", "name": "KENNETHHUGO_SG_EC2",
"name_prefix": "", "name_prefix": "",
"owner_id": "920373009484", "owner_id": "920373009484",
...@@ -1006,15 +1020,17 @@ ...@@ -1006,15 +1020,17 @@
"description": "Managed by Terraform", "description": "Managed by Terraform",
"egress": [ "egress": [
{ {
"cidr_blocks": [], "cidr_blocks": [
"0.0.0.0/0"
],
"description": "", "description": "",
"from_port": 80, "from_port": 5000,
"ipv6_cidr_blocks": [], "ipv6_cidr_blocks": [],
"prefix_list_ids": [], "prefix_list_ids": [],
"protocol": "tcp", "protocol": "tcp",
"security_groups": [], "security_groups": [],
"self": false, "self": false,
"to_port": 80 "to_port": 5000
} }
], ],
"id": "sg-0d8ac4e5a30387e18", "id": "sg-0d8ac4e5a30387e18",
...@@ -1031,6 +1047,19 @@ ...@@ -1031,6 +1047,19 @@
], ],
"self": false, "self": false,
"to_port": 80 "to_port": 80
},
{
"cidr_blocks": [],
"description": "Allow SSH from anywhere",
"from_port": 22,
"ipv6_cidr_blocks": [],
"prefix_list_ids": [],
"protocol": "tcp",
"security_groups": [
"sg-0a7ccf14d1b6468fa"
],
"self": false,
"to_port": 22
} }
], ],
"name": "KENNETHHUGO_DEV_SG_CLIENT", "name": "KENNETHHUGO_DEV_SG_CLIENT",
...@@ -1174,7 +1203,7 @@ ...@@ -1174,7 +1203,7 @@
"prefix_list_ids": null, "prefix_list_ids": null,
"protocol": "tcp", "protocol": "tcp",
"security_group_id": "sg-01d8d54afaa2f5990", "security_group_id": "sg-01d8d54afaa2f5990",
"security_group_rule_id": "sgr-09515b862f42d0f70", "security_group_rule_id": "sgr-0edaa6df0047991bd",
"self": false, "self": false,
"source_security_group_id": "sg-0a7ccf14d1b6468fa", "source_security_group_id": "sg-0a7ccf14d1b6468fa",
"timeouts": null, "timeouts": null,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment