Getting Started with Containers in Azure: Deploy Secure Cloud Applications Using Terraform 2nd Edition Shimon Ifrah download
Getting Started with Containers in Azure: Deploy Secure Cloud Applications Using Terraform 2nd Edition Shimon Ifrah download
https://ebookmass.com/product/getting-started-with-
containers-in-azure-deploy-secure-cloud-applications-using-
terraform-2nd-edition-shimon-ifrah-2/
https://ebookmass.com/product/getting-started-with-angular-create-and-
deploy-angular-applications-1st-edition-victor-hugo-garcia/
https://ebookmass.com/product/designing-applications-for-google-cloud-
platform-create-and-deploy-applications-using-java-ashutosh-shashi/
https://ebookmass.com/product/using-and-administering-linux-
volume-1-zero-to-sysadmin-getting-started-2nd-edition-david-both/
https://ebookmass.com/product/using-and-administering-linux-
volume-1-zero-to-sysadmin-getting-started-2nd-edition-david-both-2/
https://ebookmass.com/product/programming-arduino-getting-started-
with-sketches-tab-monk/
https://ebookmass.com/product/programming-arduino-getting-started-
with-sketches-third-edition-simon-monk/
Shimon Ifrah
This work is subject to copyright. All rights are solely and exclusively
licensed by the Publisher, whether the whole or part of the material is
concerned, specifically the rights of translation, reprinting, reuse of
illustrations, recitation, broadcasting, reproduction on microfilms or in
any other physical way, and transmission or information storage and
retrieval, electronic adaptation, computer software, or by similar or
dissimilar methodology now known or hereafter developed.
The publisher, the authors, and the editors are safe to assume that the
advice and information in this book are believed to be true and accurate
at the date of publication. Neither the publisher nor the authors or the
editors give a warranty, expressed or implied, with respect to the
material contained herein or for any errors or omissions that may have
been made. The publisher remains neutral with regard to jurisdictional
claims in published maps and institutional affiliations.
Introduction
Welcome to the first chapter of Deploy Containers on Azure Using Terraform. Since the release of the first
edition of this book, many things have changed, and so I decided to do a complete rewrite of the original
book and introduce the Terraform software and explain how it can help you simplify your deployments on
Azure and, more important, how it can deploy fast and always produce the same results.
The focus of this book will be on how to use Terraform to deploy container services, infrastructure
services, and other services on Azure using infrastructure as code (IaC).
Terraform is an open-source IaC tool developed by HashiCorp in order to simplify deployments of cloud
infrastructure using descriptive code language.
Once the code is deployed to Azure, it can also be version controlled and shared for development
purposes.
This chapter will focus on how to get started setting up your development environment to use Terraform
and connect to Azure and on deploying a sample resource.
Based on the assumption that you already have a working knowledge of Terraform and Azure, this book
will focus on teaching the fundamentals of these technologies.
To deploy resources to Azure using Terraform, there are a few tools I would recommend using to make
your deployment journey smoother and easier.
If you already have a preferred working setup and have the latest version of Terraform and Azure
command-line interface (CLI) installed and up and running, you don’t have to use the setup outlined in this
book, or the book recommended here.
Installing VS Code
VS Code is available for the Windows, macOS, and Linux operating systems. You can download all of these
versions from the following URL: https://code.visualstudio.com/download.
Once you download the correct version for your system, go ahead and install it.
VS Code Extensions
VS Code extensions are core components that allow software and infrastructure developers to work smarter
by complementing their capabilities with new features, functionality, and integrations.
Currently, the VS Code extensions library contains thousands of extensions that developers can use to
produce cleaner and better code.
In this book, we will use a few extensions to produce code and infrastructure in Azure.
HashiCorp Terraform: HashiCorp, the company behind Terraform, has its own official VS Code extension
that offers IntelliSense, syntax validation, syntax highlighting, code navigation, code formatting, code
snippets, a Terraform module explorer, and Terraform commands.
Azure Account: Another official Microsoft extension, Azure Account simplifies the connectivity process
between VS Code and Azure. It allows developers to connect to multiple Azure subscriptions and manage
Azure resources.
Figure 1-4 The Azure Account VS Code extension
PowerShell: Microsoft’s PowerShell VS Code extension offers support for PowerShell within VS Code and
allows writing and debugging PowerShell scripts. The extension also offers the classic PowerShell
Integrated Scripting Environment theme.
Linter: This extension offers linting capabilities that analyze and check the code written for errors and
bugs. It also offers linting capabilities for YAML files used by Kubernetes code deployments.
To lint YAML Ain’t Markup Language, or YAML, files, make sure you install the YAMLint package for
macOS or Linux.
Figure 1-6 The Linter VS Code extension
The extensions just described will help you get started using Azure and Terraform very quickly. Make sure
you have all of them installed.
wsl–install
This command will install and enable all the features that make WSL work on your computer and install
the Ubuntu distribution of Linux, which is the default, but you can change it.
If you’re using macOS or Linux, there is no need to change anything, as all the tools that we will use are
natively available on both operating systems.
Azure CLI
The next tool that we need to install is the Azure CLI command-line interface, which will allow us to manage
Azure using commands. Azure CLI is a cross-platform tool that is available on all operating systems.
This command uses WinGet, which is Windows’s package manager that allows us to install tools and
applications directly from the command line.
PowerShell 7
Microsoft PowerShell is a cross-platform command-line utility that allows us to automate tasks using
commands and scripts, and it is available on Windows, Linux, and macOS.
With PowerShell, we can install the Azure PowerShell module and manage Azure resources directly from
the command line using cmdlets or scripts.
The main selling point of PowerShell 7 is its cross-platform support, which contributed to the program’s
success and widened its limited exposure, previously being available for Windows environments only.
PowerShell 7 can be installed on all platforms using different methods. For the sake of simplicity, I will
just go over one method for each platform. For more information about the installation options, visit
PowerShell’s official website at https://github.com/PowerShell/PowerShell.
If you already have PowerShell 7 installed on your computer and would like to update it to the latest
version, run the following command to check for updates:
winget update
Once the previous version is uninstalled, install PowerShell 7 with the command that follows:
After the Homebrew installation is completed, close and reopen the Terminal and run the following
command to install PowerShell 7:
Once PowerShell 7 is installed, you can start using it by typing “pwsh.” The pwsh command starts
PowerShell and allows you to run PowerShell cmdlets or scripts.
To update all applications, including PowerShell, on macOS, run the following command:
brew update
After the command is finished, run the following command to start the update process:
brew upgrade
When the Homebrew update is completed, it will display a summary report of the updated packages,
including PowerShell 7.
wget -q
"https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-
microsoft-prod.deb"
rm packages-microsoft-prod.deb
packages.microsoft.com
Terraform
Now that we have all the tools we need to get started using Microsoft Azure and DevOps, it’s time to install
Terraform and begin the process.
Terraform is the most popular and widely used IaC software development tool available on the market
and is considered an industry standard for infrastructure deployment.
It’s also the oldest tool for infrastructure deployment and has been around for many years. Terraform
supports most major cloud providers, like AWS, or Amazon Web Services, and GCP, or Google Cloud
Platform.
Terraform uses the concept of domain-specific language, also known as HashiCorp Configuration
Language. The idea behind the language is to use a declarative approach to infrastructure code.
In the declarative approach, we define the desired state of the infrastructure and let Terraform handle
the deployment and configuration.
# main.tf
provider "azurerm" {
features {}
}
provider "azurerm" {
features {}
}
Next, we will tell Terraform to create a resource group in the Azure Web Europe data center. The name of
the resource group will be Apress-ch01. Once we run the code, Terraform will go ahead and deploy the
resource group.
We will go over the process for setting up and deploying a resource shortly. The previous code is just
meant to serve as a high-level example of how Terraform deploys infrastructure
Now that we have learned a bit about Terraform, let’s take a look at how to install it. Terraform is
available for Linux, macOS, and Windows systems. My recommendation would be to use Terraform on Linux,
macOS, or WSL. Because many DevOps tools are available natively on Linux and macOS, using Windows
won’t produce the best development results.
If you already have Terraform installed and want to update it to the latest version, you can take the
following steps.
First, update Brew using the update command: brew update. Once Brew is updated, run this
command: brew upgrade hashicorp/tap/terraform.
Now Terraform is ready to go. To check which version of Terraform is installed on your machine, run
terraform -version.
terraform -install-autocomplete.
Then we need to install the GPG security signature using the following command:
Touch ~/bashrc
The output from the command is shown in the following. The version of Terraform we’re looking for is
1.5.3.
Note When the ID of the app shows “Vendor. AppName,” it means that app is the official application.
Note Using tfenv is optional and not required to complete the labs in this book.
The tool I’m talking about is tfenv. It is a version manager for Terraform. Tfenv allows you to manage
multiple versions of Terraform on your local computer (similar to the Python virtual environment).
The tfenv process of switching between Terraform environments is simple and allows us to maintain the
compatibility of projects.
As I mentioned previously, this tool is only available on Linux and macOS; you will come across many
tools like this.
Tfenv
The output will list all the available options, as shown in the following:
tfenv 3.0.0-18-g1ccfddb
Usage: tfenv <command> [<options>]
Commands:
install Install a specific version of Terraform
use Switch a version to use
uninstall Uninstall a specific version of Terraform
list List all installed versions
list-remote List all installable versions
version-name Print current version
init Update environment to use tfenv correctly.
pin Write the current active version to ./.terraform-version
As you can tell, using tfenv is simple, which makes it very handy for operating and managing the
Terraform versions.
Let’s start by downloading a version of Terraform by typing in the following command to view which
versions are available:
Tfenv list-remote
What follows is the output of that command (note that I am only showing 14 of the versions included in
the list):
1.6.0-alpha20230719
1.5.3
1.5.2
1.5.1
1.5.0
1.5.0-rc2
1.5.0-rc1
1.5.0-beta2
1.5.0-beta1
1.5.0-alpha20230504
1.5.0-alpha20230405
1.4.6
1.4.5
1.4.4
The command output follows. If you notice, it’s being downloaded from Terraform directly.
If you check which version is active, it will show the following output:
1.5.3
* 1.5.2 (set by /home/shimon/.tfenv/version)
1.3.0
1.1.8
As I mentioned at the beginning of this section, tfenv is an optional feature and it’s not required to deploy
infrastructure. You will find that there are many handy tools available to help us be more productive and
efficient with our deployments; tfenv is just one of them.
Authenticating to Azure
The first step required to deploy resources to Azure is to authenticate, which we’ll do using Azure CLI
(PowerShell is not supported).
To authenticate to Azure, run the following command and click the resulting link to open the Azure
portal login:
az login --use-device-code
If you have multiple Azure subscriptions, run the following command to find the ID of the subscription to
which you’re going to deploy resources and copy the subscription ID.
Using the ID you copied, run the following command to set up the subscription:
We are now authenticated and ready to deploy our first Azure resource.
In this example, we are going to deploy an Azure Resource Group using Terraform with the following
code:
#1.Create_RG.tf
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
}
}
}
provider "azurerm" {
features {}
}
The previous code starts with a declaration of the Azure Terraform provider. The Azure terraform
provider is called azurerm.
We also have a provider features section where we can declare extra configuration items.
#1.Create_RG.tf
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
}
}
}
provider "azurerm" {
features {}
}
The second part of the code is the declaration of the resource group we’re going to create and deploy to
Azure.
We are deploying a resource group called ApressAzureTerraform in the Australia Southeast
data center.
Terraform init
Terraform plan
Terraform apply
Terraform destroy
In the following deployment, we’ll use all of these commands as we go through the cycle of creating and
deleting resources from Azure.
terraform init
Note We can specify a Terraform provider by using the version option in the required_provider section.
Terraform has created a lock file called .terraform.lock.hcl to record the provider selections it
made. Include this file in your version control repository so that Terraform can guarantee it makes the same
selections by default when you run "terraform init" in the future.
Note It is essential that you review the changes carefully, as changes made by Terraform are
irreversible.
Terraform apply
Let’s now review the planned changes one more time and type “yes” to confirm.
Enter a value:
After a little time, Terraform will display a message saying that the resources were deployed successfully.
The output of the message follows:
Terraform destroy
Terraform will then again display a detailed configuration message outlining the changes and their
impact on the infrastructure. It is critical that you review these changes carefully, especially when managing
live and production resources.
Enter a value:
If you are OK with the changes, type “yes” and Terraform will delete the resources outlined in the output
of the destroy command.
Summary
This chapter covered the basics of getting started with Terraform and installing the tools required to use it.
In the last section, we put all our learning into practice and deployed an Azure resource group using
Terraform.
© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2024
S. Ifrah, Getting Started with Containers in Azure
https://doi.org/10.1007/978-1-4842-9972-2_2
Introduction
We’ll start this chapter by deploying services to Azure. The first service we’re going to explore and deploy is
Azure Web App for Containers. Using the knowledge we gained in Chapter 1, we will use VS Code, Azure CLI,
and Terraform.
Azure Web App for Containers is a service that is part of Azure Web Apps that allows us to deploy web or
mobile applications to Azure without the need to deploy the underlying infrastructure, like servers and
storage, allowing us to focus only on deploying our applications and let Azure manage the rest.
The platform takes Azure Web Apps to the next level by allowing us to configure applications in Docker
and ship them to Azure Web Apps but control all the runtime configuration within the application.
The service also supports Docker and other container technologies that allow us to package our
applications and dependencies into a container image.
We have the choice to use multiple programming languages with the platform like:
.NET
Java
Python
Node
The deployment process also allows us to pull our images from container registries like Azure Container
Registry (ACR) and Docker Hub or use source-code repositories like Azure Repos or GitHub.
Provider Configuration
To simplify things and make the code more scalable and portable, I have created the following file:
provider.tf.
The provider file contains all the details of the provider, and in our case, it’s the Azure provider. By
separating the provider configuration from the main configuration files, we centralize the provider
configuration and reduce duplication.
The content of the provider.tf is:
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
}
}
}
provider "azurerm" {
features {}
}
The first block in the configuration creates a resource group. The name of the block is “rg.” Terraform doesn’t
care what you name it, but the naming does need to be consistent, and we will refer to it in the configuration.
The second piece of code, detailed in the following, creates a Linux Service plan called “Linux with P1v2
plan.”
These two blocks of code define the Docker image that will be used in the Web App for Containers and
the settings that are needed for it to run.
Note Later on in the book, we will create a private container register in Azure and use it for
deployments.
The last block of code, outlined in the following, creates the actual app that will be deployed to Web App for
Containers. The important parts in the configuration are in the applications_stack and the
app_settings blocks.
site_config {
always_on = "true"
application_stack {
docker_image_name = "httpd:latest"
docker_registry_url = "https://index.docker.io/"
}
}
app_settings = {
"DOCKER_ENABLE_CI" = "true"
}
}
The deployment that we’re using is not overly complicated but does have all the moving parts needed to
run an application on Web App for Containers.
terraform plan
The plan command will run the previous steps against every configuration file that ends with the .tf
extension.
Note To skip the confirmation approval step, we can use auto-approve, which will work with the “plan,”
“apply,” and “destroy” commands.
When using the Terraform apply command in a production environment, always review the execution plan
and ensure that you understand the changes Terraform will make before confirming.
az login --use-device-code
3. If you have more than one Azure subscription, use the following command to set your subscription:
Note To list all your Azure subscription IDs using PowerShell, use the following command: “get-
azSubscription | Select-Object Name, subscriptionid.”
You may now begin working with Terraform. Try running "terraform plan" to
see
any changes that are required for your infrastructure. All Terraform
commands
should now work.
5. The next step is to run the following plan command and review the proposed infrastructure:
Terraform plan
The output should look like this:
+ site_config {
+ always_on = true
+ container_registry_use_managed_identity = false
+ default_documents = (known after apply)
+ detailed_error_logging_enabled = (known after apply)
+ ftps_state = "Disabled"
+ health_check_eviction_time_in_min = (known after apply)
+ http2_enabled = false
+ linux_fx_version = (known after apply)
+ load_balancing_mode = "LeastRequests"
+ local_mysql_enabled = false
+ managed_pipeline_mode = "Integrated"
+ minimum_tls_version = "1.2"
+ remote_debugging_enabled = false
+ remote_debugging_version = (known after apply)
+ scm_minimum_tls_version = "1.2"
+ scm_type = (known after apply)
+ scm_use_main_ip_restriction = false
+ use_32_bit_worker = true
+ vnet_route_all_enabled = false
+ websockets_enabled = false
+ worker_count = (known after apply)
+ application_stack {
+ docker_image_name = "httpd:latest"
+ docker_registry_password = (sensitive value)
+ docker_registry_url = "https://index.docker.io/"
+ docker_registry_username = (known after apply)
}
}
}
terraform apply
The output of this command will be similar to that of the plan command. However, it will also include
the following output plus confirmation:
Enter a value:
I will go ahead and type “yes” here and let Terraform create the web application as per the configuration.
The Terraform application output is shown in the following code. The time it takes to create the
infrastructure depends on the number of resources in the configuration. In our case, it should take less than
a minute to complete the deployment.
azurerm_resource_group.rg: Creating...
azurerm_resource_group.rg: Creation complete after 1s
[id=/subscriptions/subid/resourceGroups/ApressAzureTerraformCH02]
azurerm_service_plan.appservice: Creating...
azurerm_service_plan.appservice: Creation complete after 7s
[id=/subscriptions/subid/resourceGroups/ApressAzureTerraformCH02/providers/Mic
azurerm_linux_web_app.webapp: Creating...
azurerm_linux_web_app.webapp: Still creating... [10s elapsed]
azurerm_linux_web_app.webapp: Still creating... [20s elapsed]
azurerm_linux_web_app.webapp: Still creating... [30s elapsed]
azurerm_linux_web_app.webapp: Creation complete after 33s
[id=/subscriptions/subid/resourceGroups/ApressAzureTerraformCH02/providers/Mic
Now, the web app has been deployed and we can open the properties of the web app in the Azure portal
and click the URL to see it in action.
The output of the web app is shown in Figure 2-1.
In our deployment, we’re using the httpd Docker image, which runs the Apache Web Server, and it
displays the default home page.
You can find the web app URL in the Azure portal by taking the following steps:
1. Open the Azure portal using the following URL: https://portal.azure.com.
Terraform Output
I have to say that retrieving the web app URL required a few clicks, opening a web browser, and logging into
the portal. To make our lives a bit easier, Terraform can also output the same information we retrieved from
the browser on the output screen after deploying the application.
The purpose of the output command is to display information about the deployment on our screen
without requiring us to open the portal to look for it. After all, Terraform already has all the information
about our deployment, so outputting it to the screen is simple.
The Terraform output command is very powerful and allows us to retrieve deployment values from the
Terraform state file that holds all the attributes. It also provides access to values without having to read the
state file directly.
To use the output command, I have created a file called output.tf with the following configuration:
output "web_app_url" {
value = azurerm_linux_web_app.webapp.default_hostname
}
In the configuration, I declared one output value would be called web_app_url with the Azure Web
App default hostname value.
To view the hostname of the deployed web app, we can run the terraform apply command as
normal or output the value postdeployment using:
terraform output
The following output shows the web app URL we get when we run the Terraform apply command:
Changes to Outputs:
+ web_app_url = "apresstfwebapp.azurewebsites.net"
You can apply this plan to save these new output values to the Terraform state
infrastructure.
Outputs:
web_app_url = "apresstfwebapp.azurewebsites.net"
The previous example shows one output; however, in more complex deployments, we could output
almost any attribute in the deployment.
touch .gitignore
# Ignore logs
*.log
If the .gitignore file is working, you’ll see the ignored files marked in white rather than green, as
shown in Figure 2-3, indicating that they are not being tracked.
Adding files to the .gitignore file after they’ve been tracked won’t remove them from the repository;
it will only prevent future changes from being staged.
To stop tracking files that Git already tracks, use the following Git command:
Git rm --cached
Figure 2-3 Terraform file being ignored by Git, as indicated by being marked in white
2. After adding the file, open a terminal window and find the repository with which you’d like to use the
global file, then run the following command:
Terraform destroy
Scaling
The first feature I want to touch on is the management of resources a Web App uses in terms of RAM and
CPU. As I mentioned earlier, Terraform has the capability of managing almost any aspect of our deployment
and scaling apps is one of them.
Regarding scaling, Azure Web Apps resources are managed at the app service plan resource we have in
our configuration. The code is as follows:
The process of adding more resources to an app service plan is called “scale up,” and the opposite
process is called “scale out.”
To change an app service plan, we just need to change the sku_name value as follows, and then run
Terraform apply.
Customizing Deployment
Before we move on to the next section, I’d like to show you how powerful Terraform is when it comes to
customized deployments. In the following example, we’re going to generate a random web app name for our
application using Terraform.
To make our deployments easier and much more customized, Terraform has created a few providers that
can help us generate random numbers, IDs, passwords, and more.
Going back to our Web App for Containers code, I’m now going to add a new code block that will
generate a random number that I will use to make my web app name.
In the following code block, we’ll use the random provider to generate a random number and use it to
create the name of our web app. The provider details are available at
https://registry.terraform.io/providers/hashicorp/random/latest/docs.
}
In essence, this code will generate a random number between 1 and 20. I will use that number in the web
app code block to form my web app name and URL.
site_config {
always_on = "true"
application_stack {
docker_image_name = "httpd:latest"
docker_registry_url = "https://index.docker.io/"
}
}
app_settings = {
"DOCKER_ENABLE_CI" = "true"
}
When I run the Terraform apply command, Terraform will generate a number and use it to form the
web app URL, the result of which will be:
Outputs:
web_app_url = "apresstfwebapp18.azurewebsites.net"
The URL has now been formed and has the number 18 in it.
Variable Interpolation
You probably noticed that in the part of the previous code where we generated the number and formed the
web app URL we used the following code to form the name:
"ApressTFWebApp${random_integer.random.result}"
This example is perfect for taking the opportunity to introduce the concept of variable interpolation.
In Terraform, variable interpolation is the process of using the values of variables within your Terraform
configuration. Interpolation uses the following syntax:
${}
There are two types of variable interpolation:
Variable: Used to reference the value of a variable.
Resource: Used to reference the value of a resource (used in our web app configuration).
HTTPS
Azure Web Apps allows us to secure our applications using the HTTPS protocol, and by default, every
deployment comes with an HTTPS URL enabled. To take this configuration a step further, we can also disable
the use of HTTP using Terraform.
We can add the following line to the web app block if we want to make our web app support HTTPS only:
https_only = "true"
We can also enforce our web application to communicate using only the transport layer security (TLS)
1.2 HTTPS protocol and disable the use of unsecured TLS protocols like TLS 1.0.
The following line of code will set the minimum TLS protocol to 1.2:
minimum_tls_version = "1.2"
Another security feature that we can use is static IP restriction. By default, access to our web service is
available to all IP (Internet protocol) addresses; however, we can limit which IP addresses have access to our
application using IP restrictions.
The following code block adds restrictions to our web app from a static IP block:
ip_restriction {
ip_address = "10.0.0.0/24"
action = "Allow"
# }
https_only = "true"
site_config {
always_on = "true"
minimum_tls_version = "1.2"
application_stack {
docker_image_name = "httpd:latest"
docker_registry_url = "https://index.docker.io/"
}
}
app_settings = {
"DOCKER_ENABLE_CI" = "true"
}
Private Endpoints
Private endpoints for web apps provide the ultimate security feature for securing web apps in Azure. These
endpoints only allow access to web apps from private networks and block access to them by general users
on the Internet.
A private network can be either an Azure Virtual Network (Vnet) or an on-premises network.
Private endpoints allow access to web apps from on-premises networks only or from Azure private
networks.
To configure a private endpoint, we must create a Vnet and place the web app inside the network within
the internal network interface controller (NIC).
In brief, Azure private endpoints use a private network interface that is available on a virtual network.
When a private endpoint is being created, a private IP address is assigned to the web app instead of a public
IP address.
We can also use access restrictions to white list or blacklist specific IP ranges or IP addresses.
To access a private endpoint from a Vnet, Azure uses a private domain name system (DNS) zone to
resolve the private IP address.
https_only = "true"
site_config {
always_on = "true"
minimum_tls_version = "1.2"
application_stack {
docker_image_name = "nginx:latest"
docker_registry_url = "https://index.docker.io/"
}
}
app_settings = {
"DOCKER_ENABLE_CI" = "true"
vnet_route_all_enabled = "true"
resource "azurerm_app_service_virtual_network_swift_connection"
"vnetintegrationconnection" {
app_service_id = azurerm_linux_web_app.webapp.id
Other documents randomly have
different content
The Project Gutenberg eBook of Juvenile
Sports; or, Youth's Pastimes
This ebook is for the use of anyone anywhere in the United
States and most other parts of the world at no cost and with
almost no restrictions whatsoever. You may copy it, give it away
or re-use it under the terms of the Project Gutenberg License
included with this ebook or online at www.gutenberg.org. If you
are not located in the United States, you will have to check the
laws of the country where you are located before using this
eBook.
Author: Anonymous
Language: English
OR
YOUTH'S PASTIMES
London
Pub. by R. Miller, 24 Old Fish S. Doctors Coms.
Would you either skate, or slide,
Ever Oh! of falls beware,
Pain often, stands by pleasures side
Broken heads, are skaiters fare.
The Bear is in a surly mood,
I, should not like him in a wood,
Then buffet him, if you advance,
But mind, this knot, shall make you
dance.
Come, trundle now your Hoops, my
boys,
And drive them quick along,
While each his favorite sport enjoys,
Amidst the jovial throng.
The little Vessel spreads all sail,
Swift wafted by the gentle gale,
And as she glides along the stream,
Their eager eyes, with pleasure beam.
High bounding like the nimble deer
At Leapfrog, blithesome boys appear
While health gives vigour to the frame
And fits them for the active game.
With bat and trap, the Youth's agre'd
To send the ball abroad with speed,
While eager with his open hands,
To catch him out, his playmate stands.
This Boy with spirit, whips his top,
And makes it circling, spin and hop,
Then out of breath, he sits awhile,
To rest him from the pleasing toil.
The Kite majestic soars on high,
In various gambols, thro' the sky,
Deck'd out with stars and colors gay,
Upon the schoolboys holiday.
The time for playing Top is in,
By Proclamation, let them spin,
To drive the counter, to its bound,
Upon the smooth enamell'd ground.
The Pins in even order stand,
Like ranks of soldiers, in a band,
And many a Youth before his prime,
Is fell'd, by that arch bowler—Time.
Now each regardless of a fall,
With crooked stick, oft strikes the ball,
Which o'er the icy surface flies,
The adventr'us game, with ardour plies.
*** END OF THE PROJECT GUTENBERG EBOOK JUVENILE SPORTS;
OR, YOUTH'S PASTIMES ***
1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside
the United States, check the laws of your country in addition to
the terms of this agreement before downloading, copying,
displaying, performing, distributing or creating derivative works
based on this work or any other Project Gutenberg™ work. The
Foundation makes no representations concerning the copyright
status of any work in any country other than the United States.
1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if
you provide access to or distribute copies of a Project
Gutenberg™ work in a format other than “Plain Vanilla ASCII” or
other format used in the official version posted on the official
Project Gutenberg™ website (www.gutenberg.org), you must,
at no additional cost, fee or expense to the user, provide a copy,
a means of exporting a copy, or a means of obtaining a copy
upon request, of the work in its original “Plain Vanilla ASCII” or
other form. Any alternate format must include the full Project
Gutenberg™ License as specified in paragraph 1.E.1.
• You pay a royalty fee of 20% of the gross profits you derive
from the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”
• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.
1.F.
ebookmasss.com