./priv/layers/admin-api.json in stacco-0.1.30 vs ./priv/layers/admin-api.json in stacco-0.1.32
- old
+ new
@@ -1,9 +1,10 @@
{
"Resources": {
+
"AdminAPISecurityGroup": {"Type": "AWS::EC2::SecurityGroup", "Properties": {
"GroupDescription": "Admin API security group",
"VpcId": {"Ref": "VPC"},
"SecurityGroupIngress": [
@@ -80,11 +81,11 @@
"ResourceRecords": [{"Fn::GetAtt": ["AdminAPILoadBalancer", "DNSName"]}]
}},
"AdminAPIScalingGroup": {
"Type": "AWS::AutoScaling::AutoScalingGroup",
- "DependsOn": "PrivateRoute",
+ "DependsOn": "BastionBoxReady",
"UpdatePolicy": {
"AutoScalingRollingUpdate": {
"MinInstancesInService": "1",
"MaxBatchSize": "1",
@@ -115,19 +116,70 @@
}
},
"AdminAPIScalingGroupReadyWaitHandle": {"Type": "AWS::CloudFormation::WaitConditionHandle", "Properties": {}},
-"AdminAPIScalingGroupReady": {"Type": "AWS::CloudFormation::WaitCondition", "Properties": {
- "Handle": {"Ref": "AdminAPIScalingGroupReadyWaitHandle"},
- "Count": "1",
- "Timeout": "1600"
-}},
+"AdminAPIScalingGroupReady": {
+ "Type": "AWS::CloudFormation::WaitCondition",
+ "DependsOn": "AdminAPIScalingGroup",
+ "Properties": {
+ "Handle": {"Ref": "AdminAPIScalingGroupReadyWaitHandle"},
+ "Count": "1",
+ "Timeout": "5000"
+ }
+},
+
+
+"BitcoinDaemonRole": {
+ "Type": "AWS::IAM::Role",
+ "Properties": {
+
+ "AssumeRolePolicyDocument": {
+ "Statement": [ {
+ "Effect": "Allow",
+ "Principal": {
+ "Service": [ "ec2.amazonaws.com" ]
+ },
+ "Action": [ "sts:AssumeRole" ]
+ } ]
+ },
+
+ "Path": "/",
+
+ "Policies": [{
+ "PolicyName": "BlockchainAccess",
+
+ "PolicyDocument": {
+ "Statement": [{
+ "Effect": "Allow",
+ "Action": "s3:*",
+ "Resource": [
+ "arn:aws:s3:::bex-blockchain-main",
+ "arn:aws:s3:::bex-blockchain-main/*",
+ "arn:aws:s3:::bex-blockchain-testnet3",
+ "arn:aws:s3:::bex-blockchain-testnet3/*"
+ ]
+ }]
+ }
+ }]
+
+ }
+},
+
+"BackendProfile": {
+ "Type": "AWS::IAM::InstanceProfile",
+ "Properties": {
+ "Path": "/",
+ "Roles": [{"Ref": "BitcoinDaemonRole"}]
+ }
+},
+
+
+
"BackendLaunchConfiguration" : {
"Type" : "AWS::AutoScaling::LaunchConfiguration",
- "DependsOn": "GatewayToInternet",
"Metadata": {
"AWS::CloudFormation::Init": {}
},
@@ -135,10 +187,10 @@
"InstanceType": "m3.medium",
"ImageId": {"Ref": "InstanceAMIVar"},
"KeyName": {"Ref": "IAMKeypairNameVar"},
"SecurityGroups": [{"Ref": "BackendSecurityGroup"}],
- "AssociatePublicIpAddress": "true",
+ "IamInstanceProfile" : {"Ref": "BackendProfile"},
"BlockDeviceMappings": [
{"DeviceName": "/dev/xvdc", "Ebs": {
"SnapshotId": {"Ref": "DockerLibrarySnapshotVar"},
"VolumeSize": "50"